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 - iphone keyboard doesn't send 'return' and 'backspace' events
Summary: iphone keyboard doesn't send 'return' and 'backspace' events
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 normal
Assignee: Vittorio Giovara
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 18:06 UTC by Vittorio Giovara
Modified: 2011-02-01 09:05 UTC (History)
1 user (show)

See Also:


Attachments
fix the missing return event (1.37 KB, application/octet-stream)
2010-07-16 18:06 UTC, Vittorio Giovara
Details
fix the missing return event (and a compiler warning) (947 bytes, patch)
2010-07-16 18:22 UTC, Vittorio Giovara
Details | Diff
fix return, backspace and multiple calls to keyboards (1.35 KB, patch)
2011-02-01 02:25 UTC, Vittorio Giovara
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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