We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4587

Summary: Hardware keyboard doesn't report any event on iOS
Product: SDL Reporter: romain.goyet
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sdl-bugzilla
Version: HG 2.1   
Hardware: iPhone/iPod touch   
OS: iOS 11   

Description romain.goyet 2019-04-09 16:27:51 UTC
While there is support for on-screen software keyboard on iOS, apparently hardware keyboard support is missing.
Comment 1 Sam Lantinga 2019-06-12 03:05:55 UTC
This is implemented now:
http://www.libsdl.org/tmp/SDL-2.0.zip
Comment 2 romain.goyet 2019-07-02 14:45:07 UTC
Actually, this is only partially fixed: some keys work, but many don't!

Here are the keys that did produce an event with type SDL_KEYDOWN:
 - Arrow keys
 - Esc key

All the other keys don't produce any event at all. Number, letters, control keys just don't do anything at all.
Comment 3 Sam Lantinga 2019-07-02 15:23:25 UTC
On iOS you need to enable text input, or the OS won't generate any keyboard events. There's nothing we can do here, that's just the way it works. Unfortunately enabling text input will also pop up the onscreen keyboard, and you can't tell until you do that whether a hardware keyboard is attached - by OS design.

That's my understanding, if you find out differently, please let me know!
Comment 4 romain.goyet 2019-07-02 15:28:54 UTC
You might very well be right, thanks for replying.
I'll try to look things up and will reopen this ticket if I've anything interesting to add to the conversation :)