Posted: 30th Sep 2011 20:14
My buttons stopped working. Suddenly getbuttonstate and getbuttonpressed no longer return anything. It's like the buttons no longer are recognized. Directions still work but not the 5 buttons.

Anybody else experiencing this problem?
Posted: 30th Sep 2011 23:01
This is for a joystick, right?
Posted: 30th Sep 2011 23:48
No the buttons involved in GetButtonPressed(1-5) aren't working.
Posted: 1st Oct 2011 0:06
Oh, I see.

I haven't used the virtual joystick buttons, just the regular virtual buttons. See the help here

http://www.appgamekit.com/documentation/Reference/Input/GetButtonPressed.htm

for the joystick buttons. Do you have a keyboard attached? Since I DO have a keyboard attached, GetButtonPressed() gets called by the spacebar for button 1, etc.

For example, this code:

+ Code Snippet
do
    Print(GetButtonState(1))
    Print(GetButtonPressed(1))
    Sync()
loop


shows that button number 1 is triggered by my spacebar.

I'm not near my iPad, so I can't test it with no joystick and no keyboard. Are you testing on a phone/tablet?

Are you using AddVirtualButton()? It works fine for me.
Posted: 1st Oct 2011 2:36
I'm using it on windows now and the buttons (space, q,w,e,r,ctrl) aren't responding --they did at first and just recently quit working.

For example, the code:


do
a$ = str(getbuttonstate(1))+str(getbuttonstate(2))+str(getbuttonstate(3))+str(getbuttonstate(4))+str(getbuttonstate(5))
Print(a$)

Sync()
loop


shows all zeroes no matter what I press.
Posted: 1st Oct 2011 20:31
For now I'm using getrawkeystate() as a work-around.
Posted: 1st Oct 2011 21:25
Very strange. Your posted code works fine for me, each of the keys changes the appropriate zero to one.
Posted: 1st Oct 2011 22:52
I wonder what's making my AppGameKit lose track of them...