Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / [Q] Joystick Up()

Author
Message
ZEDi Knight
18
Years of Service
User Offline
Joined: 12th Apr 2006
Location:
Posted: 13th Apr 2006 04:25
hi,

I ran into an interesting problem with the following code.



do

bUpKey = 0
bUpKey = JOYSTICK UP()
if bUpKey = 1
printf \"Joystick UP = 1\"
else
printf \"Joystick UP = 0\"
endif

loop

The program executes correctly until I press the joystick up.

It will continuously report Joystick UP = 1 even after I release the button.

If press the joystick down the program will report, properly,

Joystick UP = 0

If I touch no controls on the pad it will resume to report,

Joystick UP = 1

which is a false case.

Any ideas.

The program above replicates the issue. The joysitck works properly.

thanks

Rem R = Rx Ry Rz
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Apr 2006 13:18
Your code works fine on my joystick (Microsoft Sidewinder)

Can you try the following code and see what happens;



Boo!
Ant
19
Years of Service
User Offline
Joined: 27th Nov 2004
Location:
Posted: 13th Apr 2006 13:22
Based on your code you could try this :

the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 16th Apr 2006 19:03 Edited at: 16th Apr 2006 19:03
The JOYSTICK UP/DOWN/LEFT/RIGHT commands only really work with digital joysticks. Any movement away from 0,0 causes the commands to register movement. This is useless for most analog controlers because it is near enough impossible to move them on one axis without slightly moving it on the other.

You need to write your own joystick functions that use JOYSTICK X/Y combined with a deadzone.



By way of demonstration, he emitted a batlike squeak that was indeed bothersome.

Login to post a reply

Server time is: 2024-09-24 21:38:54
Your offset time is: 2024-09-24 21:38:54