joystick commands

Previous topic - Next topic

xelon

Do the joystick commands only work in windowed mode?

AndyH

It should work.  Looks like a bug.  Can confirm when I put my game full screen the joystick no longer responds.

Schranz0r

Move to Bug-Reports ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

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.

BumbleBee

It definitely works in fullscreen.Tested on three different Windows Pc's.:D

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

AndyH

Doesn't work here.  I'm on Windows Vista.

AndyH

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?

Kitty Hello

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.

AndyH

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).

BumbleBee

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
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Moru

Well Gernot keeps saying not to use the setscreen command, set it in the project options, mabe he knows something we don´t? :-)

Kitty Hello

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.

AndyH

Works for me now. Thanks.

xelon

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.