NeoTechni Well-Known Member Licensed User Longtime User May 25, 2011 #1 If I were to say, make a game. I can't rely on the events, I'd have to poll each button's status with a timer. How would I do so?
If I were to say, make a game. I can't rely on the events, I'd have to poll each button's status with a timer. How would I do so?
Erel B4X founder Staff member Licensed User Longtime User May 26, 2011 #2 There is no way to poll buttons status. You will need to use the events. Upvote 0
NeoTechni Well-Known Member Licensed User Longtime User May 26, 2011 #3 Erel said: There is no way to poll buttons status. You will need to use the events. Click to expand... Dang. Cause there aren't events for the button being released, or still being held. And this is an important thing to make games, that makes the opengl libraries worthless without it Upvote 0
Erel said: There is no way to poll buttons status. You will need to use the events. Click to expand... Dang. Cause there aren't events for the button being released, or still being held. And this is an important thing to make games, that makes the opengl libraries worthless without it
agraham Expert Licensed User Longtime User May 26, 2011 #4 You should be able to use my Gestures library to detect press and release on any View. I've just tried it on a button and it seems fine. The only problem will be that when you start the gesture on a view it will keep receiving gesture data until you lift off, even if the gesture leaves the the view. A bit of logic could solve this. You could also use Panels or areas within a Panel to simulate buttons, again using the Gestures library. Upvote 0
You should be able to use my Gestures library to detect press and release on any View. I've just tried it on a button and it seems fine. The only problem will be that when you start the gesture on a view it will keep receiving gesture data until you lift off, even if the gesture leaves the the view. A bit of logic could solve this. You could also use Panels or areas within a Panel to simulate buttons, again using the Gestures library.
NeoTechni Well-Known Member Licensed User Longtime User May 26, 2011 #5 agraham said: I've just tried it on a button and it seems fine. . Click to expand... A hardware button? You seem to be talking about the touchscreen. I'm talking about this: Upvote 0
agraham said: I've just tried it on a button and it seems fine. . Click to expand... A hardware button? You seem to be talking about the touchscreen. I'm talking about this:
agraham Expert Licensed User Longtime User May 26, 2011 #6 NeoTechni said: You seem to be talking about the touchscreen. Click to expand... Of course. Upvote 0
NeoTechni Well-Known Member Licensed User Longtime User May 26, 2011 #7 Yeahh... The touchscreen is nigh worthless for games. Upvote 0
K kickaha Well-Known Member Licensed User Longtime User May 26, 2011 #8 Is the D-pad in the SDK ? if it is could it be checked using the reflection library? Upvote 0
NeoTechni Well-Known Member Licensed User Longtime User May 26, 2011 #9 Its just 4 hardware buttons Upvote 0
K kickaha Well-Known Member Licensed User Longtime User May 26, 2011 #10 NeoTechni said: Its just 4 hardware buttons Click to expand... As I understand it, these are mapped as part of a hardware keyboard (probably as cursor keys). There must be a way of getting the keystate from the KeyboardActionListener using the reflection library. If you are in an EditText what effect does pressing these buttons have? do they repeat? Upvote 0
NeoTechni said: Its just 4 hardware buttons Click to expand... As I understand it, these are mapped as part of a hardware keyboard (probably as cursor keys). There must be a way of getting the keystate from the KeyboardActionListener using the reflection library. If you are in an EditText what effect does pressing these buttons have? do they repeat?
NeoTechni Well-Known Member Licensed User Longtime User Mar 5, 2012 #11 kickaha said: As I understand it, these are mapped as part of a hardware keyboard (probably as cursor keys). Click to expand... They are mapped as simple buttons. But how do I check their states? There is no key up event, just a down Upvote 0
kickaha said: As I understand it, these are mapped as part of a hardware keyboard (probably as cursor keys). Click to expand... They are mapped as simple buttons. But how do I check their states? There is no key up event, just a down
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2012 #12 You can handle Activity_KeyPress and Activity_KeyUp. KeyPress is equivalent to KeyDown. Upvote 0
NeoTechni Well-Known Member Licensed User Longtime User Mar 5, 2012 #13 Erel said: You can handle Activity_KeyPress and Activity_KeyUp. KeyPress is equivalent to KeyDown. Click to expand... Ahhh. That's perfect. Thank you. Upvote 0
Erel said: You can handle Activity_KeyPress and Activity_KeyUp. KeyPress is equivalent to KeyDown. Click to expand... Ahhh. That's perfect. Thank you.
T ThiagoRodrigues Member Licensed User Longtime User Apr 20, 2014 #14 Specifically for Xperia Play, what about the touch pad? It won´t raise a keypress event... is it possible to read it? Regards, Upvote 0
Specifically for Xperia Play, what about the touch pad? It won´t raise a keypress event... is it possible to read it? Regards,
NeoTechni Well-Known Member Licensed User Longtime User Apr 20, 2014 #15 Nope. Sony screwed up hard on it. It only works in ndk apps, not java Upvote 0
T ThiagoRodrigues Member Licensed User Longtime User Apr 20, 2014 #16 yeah.... that´s what I was afraid of... it´s a shame... Upvote 0
NeoTechni Well-Known Member Licensed User Longtime User Apr 20, 2014 #17 It gets worse. It doesn't work at all on ICS Upvote 0