Android Physical arrow keys not generating keyboard events |
Android Physical arrow keys not generating keyboard events |
slvn
|
I have seen the same issue.
Keyboard arrows are sent to "joystick" module, where they are translated as D-PAD keys, but they are *not* consumed and are *not* sent to the "keyboard module". Normal key are also sent to "joystick" module, but they are *not* translated, so they are then sent to the "keyboard" module. I have filled a bug + pseudo-patch there: https://bugzilla.libsdl.org/show_bug.cgi?id=2948 On Fri, Mar 13, 2015 at 11:40 AM, AntTheAlchemist wrote:
|
|||||||||||||
|
AntTheAlchemist
|
slvn & sam, thank-you for applying a patch to fix this.
However, I'm still not getting keyboard events. I'm now getting joystick button events instead. This not the desired result. I'd like to receive keyboard events the same way the other platforms work. |
|||||||||||
|
AntTheAlchemist
|
I'm not even getting D-Pad joystick events. Just controller button numbers.
|
|||||||||||
|
AntTheAlchemist
|
Right, I've done some digging. Physical keyboard arrow keys work as normal keyboard events if I don't handle any joysticks or controllers.
That is to say, if I support joysticks and open all the joysticks detected by the system, physical keys become joystick buttons instead of keyboard key presses. On every Android device I have, there are at least 1 (sometimes 3) strange joysticks detected by SDL, even though no gamepads or joysticks are plugged into the system. They're named things such as "2.4G Wireless Device", "1 rk29-keypad", "Virtual". None of which are joysticks. The only way I know how to fix this is to filter out these non-joystick notifications and don't add them based on what they're called? They serve no use whatsoever and don't produce any axis or button events other than when I'm pressing physical arrow keys. This isn't the desired effect. I only want to see actual real game controllers and joysticks being reported by SDL, otherwise I'm offering the end-user spurious game-controllers that aren't game controllers. Not to mention, it breaks the physical keyboard arrow keys. Any suggestions? |
|||||||||||
|