HELP! I find an issue using _DEVICES! - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: HELP! I find an issue using _DEVICES! (/showthread.php?tid=1653) Pages:
1
2
|
HELP! I find an issue using _DEVICES! - TempodiBasic - 05-01-2023 Hi QB64 coders I was attempting to accomplish this task detecting a joystick and its settings of buttons/axis using the original code I thought that I made an error in typing code. So with the goal to solve this issue of detecting a Joystick before to change its settings of _BUTTONS, I fall in this issue that you can live running this code and following these instructions: 1. copy and paste this code into QB64 IDE 2. take near you an USB joystick 3. press F5 after QB64 IDE with this demo code has got the focus 4. you should get message "NO Joystick! 2 0 0 0" 5. pressing ENTER key you should get the same message on the screen 6. Plug in the USB joystick to the PC/Notebook and wait for the sound of controller connected by Windows 11 7. press 3 times ENTER Key, you should get a message "Joystick detected 3 .........." three times 8. disconnect the USB joystick and wait for the sound of controller disconnected by Windows 11 9. press ENTER key and WHAT message do you get back? Here the code that I used Code: (Select All) Here my weird output detection is stuck! So please make bigger my knowledge with your feedbacks! Where is the mistake in the code? Thank you for your apport! RE: HELP! I find an issue using _DEVICES! - TerryRitchie - 05-01-2023 I just finished a complete lesson on controller devices in my tutorial. https://www.qb64tutorial.com/lesson21 I believe the issue you are having is that you are not using _DEVICEINPUT first before polling the controllers for information. The lesson goes through step by step on how to properly poll controller devices for information. _DEVICES and related statements are a bit tricky to use and set up properly. I'm sure this tutorial lesson will help you. RE: HELP! I find an issue using _DEVICES! - Jack - 05-01-2023 Hi Terry I just read your mini biography, very interesting. RE: HELP! I find an issue using _DEVICES! - SMcNeill - 05-01-2023 If you guys are going to be using _Devices, you might want to test it with our latest repo version. QB64PE v3.7 should be releasing soon(tm), and it's got several fixes and enhancements on _Devices. RE: HELP! I find an issue using _DEVICES! - TempodiBasic - 05-02-2023 Hi Terry thanks for the link! I have already followed the birth of your Controller Library on this forum. I must see the latest adjournments that you have published. In the while I read your Lesson 21 with calm, (your Controller Library can be the solution of the issue) , here the root of my code Quote:Another thing to fix I realized is the test for the presence of a joystick needs to come inside the menu loop, at the top. That way you can plug a controller in without having to restart the program. from this post #30 of old QB Defender thread... the far away goal is to let plug in/out a controller without restart the program. The code in #1 of this thread attempts to scan devices activated on the pc after a command input (ENTER key). The strange behaviour that I got is that after a first good run the following testings are stucked! I'll search in your lesson 21 the solution to my issue. Thank you RE: HELP! I find an issue using _DEVICES! - TempodiBasic - 05-02-2023 (05-01-2023, 11:42 PM)SMcNeill Wrote: If you guys are going to be using _Devices, you might want to test it with our latest repo version. I just now tried using v 3.6.0 but the story seems to be the same. here screenshot at start (first row of results) there was no joystick plugged in. Then I plugged in a joystick 2 axis and 10 buttons (second row of results) After this I plugged out the same joystick and I got the other three row of results. NB: the first number is the name of devices in the pc (under the Joystick column) and in the bottom on the left is the keycode got by _Keyhit. RE: HELP! I find an issue using _DEVICES! - TerryRitchie - 05-02-2023 (05-01-2023, 11:33 PM)Jack Wrote: Hi Terry Yeah, I didn't take the usual path through life. RE: HELP! I find an issue using _DEVICES! - TerryRitchie - 05-02-2023 (05-01-2023, 11:42 PM)SMcNeill Wrote: If you guys are going to be using _Devices, you might want to test it with our latest repo version. Looking forward to 3.7 with regards to _devices so I can finish the _wheel portion of the controller library. Also, I believe you mentioned in an earlier post that _PRINTSTRING would be much faster as well, is this correct? RE: HELP! I find an issue using _DEVICES! - SMcNeill - 05-02-2023 RE: HELP! I find an issue using _DEVICES! - TerryRitchie - 05-02-2023 Definitely looking forward to the print improvements! |