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 1025

Summary: iphone keyboard doesn't send 'return' and 'backspace' events
Product: SDL Reporter: Vittorio Giovara <vitto.giova>
Component: videoAssignee: Vittorio Giovara <vitto.giova>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: drago.ruzman
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS (All)   
Attachments: fix the missing return event
fix the missing return event (and a compiler warning)
fix return, backspace and multiple calls to keyboards

Description Vittorio Giovara 2010-07-16 18:06:41 UTC
Created attachment 517 [details]
fix the missing return event

my application builds a chat system so that users write and send their messages by pressing ENTER.
however i noticed that the ENTER event does never get sent from an iphone/ipad keyboard, thus no message can be sent. I've attached a small patch that fixes this, i used the 13th slot because it's the "carriage return" value in the ashii table.

another issue, also the BACKSPACE has problems: when the keyboard appears it works fine, but if it gets hidden no more backspace are sent. Unfortunately i don't have a patch to fix this, but i hope that it can be fixed.
Comment 1 Vittorio Giovara 2010-07-16 18:22:44 UTC
Created attachment 518 [details]
fix the missing return event (and a compiler warning)

sorry, i uploaded a corrupted patch; here is the one working against latest hg revision.
Comment 2 Vittorio Giovara 2010-07-17 06:14:00 UTC
upon further inspection, also the RETURN event I added is sent only the first time the keyboard appears.
My guess is that there must be some kind of corruption in sending the RETURN and BACKSPACE event (the event is not really generated, so the problem shouldn't be in receiving events)
Comment 3 drago.ruzman 2010-09-23 01:22:23 UTC
It seems that textField (SDL_uikitview.m) doesn't call it's delegate when backspace key is pressed, but the keypress DOES erase content from textField (can be easily checked if you assign dummy text to textField.text property). It always happens after the second call to showKeyboard during the application runtime.
Comment 4 Vittorio Giovara 2011-02-01 02:25:48 UTC
Created attachment 564 [details]
fix return, backspace and multiple calls to keyboards

i have attached an updated patch that fixes this behaviour
Comment 5 Sam Lantinga 2011-02-01 09:05:20 UTC
Thanks for the patch!
http://hg.libsdl.org/SDL/rev/c63b901d97ab