GLBasic forum

Main forum => Bug Reports => Topic started by: xelon on 2008-Mar-11

Title: joystick commands
Post by: xelon on 2008-Mar-11
Do the joystick commands only work in windowed mode?
Title: joystick commands
Post by: AndyH on 2008-Mar-11
It should work.  Looks like a bug.  Can confirm when I put my game full screen the joystick no longer responds.
Title: joystick commands
Post by: Schranz0r on 2008-Mar-12
Move to Bug-Reports ;)
Title: joystick commands
Post by: Kitty Hello on 2008-Mar-12
ok, I'll take a look at it. Thx for mentioning. I don't use fullscreen at all, that's why sometimes these things happen.
Title: joystick commands
Post by: BumbleBee on 2008-Mar-12
It definitely works in fullscreen.Tested on three different Windows Pc's.:D

Cheers
Title: joystick commands
Post by: AndyH on 2008-Mar-12
Doesn't work here.  I'm on Windows Vista.
Title: joystick commands
Post by: AndyH on 2008-Mar-12
Just thought, are you using JOYSTATE or GETJOY... ?  I think (if I remember correctly) I am using GETJOY as it returns a values for analogue sticks.  JOYSTATE only returns digital values doesn't it?  Maybe one works and the other doesn't.  Otherwise maybe it's a problem related with XP v Vista etc?
Title: joystick commands
Post by: Kitty Hello on 2008-Mar-12
JOYSTATE returns (should at least) GETJOYX(0), GETJOYY(0), GETJOYB(0,0), GETJOYB(0,1).
I'll take a look at that when I'm home tonight, maybe.
Title: joystick commands
Post by: AndyH on 2008-Mar-12
Code (glbasic) Select
SETSCREEN 640,480,0
LIMITFPS 60


GLOBAL jx, jy, ba,bb


WHILE TRUE
JOYSTATE jx,jy,ba,bb
PRINT "JoyState x="+ jx+", y="+jy,0,0

jx = GETJOYX(0)
jy = GETJOYY(0)

PRINT "Get Joy x="+ jx+", y="+jy,0,10

SHOWSCREEN
WEND
Run that (window).  Both methods return a value.  JOYSTATE only returns 0, -1 or +1 for the x and y.  GETJOYX / Y return any value from -1.0 to +1.0 as an analogue value.

Change the code so SET SCREEN is full screen and run.

Joystate x=0, y=-35826
Get Joy x=1, y=1

And the values never change.

I'm on Vista, with a Thrustmaster rumble type USB joystick (resembles a PS2 joypad).
Title: joystick commands
Post by: BumbleBee on 2008-Mar-12
Oh dear. I guess i found the bug.:D

Do not use the SETSCREEN command for fullscreen. Go to Project/Options and change it  to fullscreen.

Gernot, now it's your turn. :D

Cheers
Title: joystick commands
Post by: Moru on 2008-Mar-13
Well Gernot keeps saying not to use the setscreen command, set it in the project options, mabe he knows something we don´t? :-)
Title: joystick commands
Post by: Kitty Hello on 2008-Mar-13
No, I don't say "do not use it". I just suggest not using it when appropriable. It must work, however. Bug, I'm about to fix it.

Fixed? - uploading Update.
Title: joystick commands
Post by: AndyH on 2008-Mar-13
Works for me now. Thanks.
Title: joystick commands
Post by: xelon on 2008-Mar-13
Yes it now works for me as well.

I have to swap between fullscreen and windowed depending on which of the kids pc i'm running the program on.

Thanks for your help.