Author Topic: Open Pandora hat y always -1  (Read 1987 times)

Offline Zuk

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
Open Pandora hat y always -1
« on: 2012-Feb-05 »
I don't know if this is an issue with the Open Pandora or with GLBasic. When I compile for the Pandora, joystick hat y always always returns a value of -1. I am using the iControlPad (which doesn't use a hat, the d-pad registers as buttons). The same program compiled for windows works correctly. I have gotten the same results on two separate Pandora handhelds. I'm using the latest GLBasic update and Pandora firmware hotfix 7. I looked around but I haven't found any info on this issue. Any help would be greatly appreciated.

Thanks!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10832
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Open Pandora hat y always -1
« Reply #1 on: 2012-Feb-06 »
how did you connect the iControlPad? As a Joypad in bluethooth mode?

Can you enumerate all joypads in the system (GETNUMJOY) and their name?

Offline Zuk

  • Mc. Print
  • *
  • Posts: 2
    • View Profile
Re: Open Pandora hat y always -1
« Reply #2 on: 2012-Feb-07 »
Yes, I am connecting the iContolPad as a joypad in bluetooth mode. What I see is that if no joypad is connected the joystick 0 name is "gpio-keys" and hat y is always -1. If I connect the iControlPad it becomes joystick 0, also with hat y value of -1.

I'd like to support multiple kinds of game pads, so my code looks similar to this:

IF GETDIGY(self.GamePadNumber) = -1 OR GETJOYBUTTON(self.GamePadNumber, self.UpButton)

self.Up = TRUE

ELSE

self.Up = FALSE

ENDIF

Because I poll both the hat and an assignable button (because the iControlPad doesn't have a hat) my code always thinks up is being pressed.

I started a thread over on the Pandora forums, but I haven't gotten any bites there:

http://boards.openpandora.org/index.php?/topic/7043-glbasic-hat-y-always-reads-1/

Thanks!
« Last Edit: 2012-Feb-07 by Zuk »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10832
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Open Pandora hat y always -1
« Reply #3 on: 2012-Feb-07 »
Very strange. I'm just using plain SDL-input for the Pandora.