Author Topic: joystick commands  (Read 5589 times)

xelon

  • Guest
joystick commands
« on: 2008-Mar-11 »
Do the joystick commands only work in windowed mode?

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
joystick commands
« Reply #1 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.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5081
  • O Rly?
    • View Profile
joystick commands
« Reply #2 on: 2008-Mar-12 »
Move to Bug-Reports ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
joystick commands
« Reply #3 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.

Offline BumbleBee

  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 891
    • View Profile
joystick commands
« Reply #4 on: 2008-Mar-12 »
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

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
joystick commands
« Reply #5 on: 2008-Mar-12 »
Doesn't work here.  I'm on Windows Vista.

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
joystick commands
« Reply #6 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?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
joystick commands
« Reply #7 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.

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
joystick commands
« Reply #8 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).

Offline BumbleBee

  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 891
    • View Profile
joystick commands
« Reply #9 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
The day will come...

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

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1792
    • View Profile
    • Homepage
joystick commands
« Reply #10 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? :-)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
joystick commands
« Reply #11 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.

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
joystick commands
« Reply #12 on: 2008-Mar-13 »
Works for me now. Thanks.

xelon

  • Guest
joystick commands
« Reply #13 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.