Certain physical keys apparently not triggering SDL_TEXTINPUT events on Android with physical keyboard (bluetooth, ...)


#1

Certain physical keys appear to be not triggering SDL_TEXTINPUT events for me on Android with actual physical keyboards (bluetooth, …), among them the space bar and other rather important ones.

Since this works on desktop this is kind of a jarring difference, especially since at least in my tests I’ve noticed that for the virtual keyboard, it seems to be the other way around with only the SDL_TEXTINPUT events triggered, and no physical SDL_KEYDOWN/UP instead.

Is this a possible configuration problem of some sort on my side, is anyone else seeing this? Just wanted to make sure before I filed a bug


#2

I’ve noticed similar problems in the past but haven’t tested this on recent versions of SDL. The problem occurred for me when I started opening joysticks. These joysticks were actually physical keyboards mistaken as joysticks by SDL, and once opened they would block the arrow keys and Enter key of the physical keyboards. I raised a bug years ago but nobody looked at it, but the offending Java code has since changed a few times and now there is this new HID stuff in 2.0.9 which could change everything again.

Also look at SDL_HINT_TV_REMOTE_AS_JOYSTICK.


#3

This sounds like it may be unrelated, I don’t do anything with joysticks or gamepad. I don’t touch that part of the API at all. I really just use SDL_TEXTINPUT, and for a bluetooth keyboard, e.g. the space key just doesn’t trigger it. (Or maybe it is related, who knows, but I’m not doing anything game-y, just basic keyboard & touch events)

The keys aren’t also FULLY blocked, they just don’t emit SDL_TEXTINPUT, while SDL_KEYUP/SDL_KEYDOWN still work.


#4

This seems to be solved with SDL 2.0.9, so the SDL I used was just too old!