{"id":1065,"date":"2013-02-07T06:26:00","date_gmt":"2013-02-07T06:26:00","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1065"},"modified":"2013-02-07T06:26:00","modified_gmt":"2013-02-07T06:26:00","slug":"iphone-sdl-1-3-sdl2-keyboard-disappearing-and-misregistration-issues","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2013\/02\/iphone-sdl-1-3-sdl2-keyboard-disappearing-and-misregistration-issues\/","title":{"rendered":"iPhone SDL 1.3 (SDL2) keyboard disappearing and misregistration issues."},"content":{"rendered":"<p>I was having a couple of issues with the SDL keyboard on the iPhone. The first was that the keyboard disappears when you press enter, I didn&#8217;t want this. So I made the following change to SDL_uikitview.m:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/* Terminates the editing session *\/\r\n- (BOOL)textFieldShouldReturn:(UITextField*)_textField\r\n{\r\n    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);\r\n    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);\r\n    \/\/SDL_StopTextInput();\r\n    return YES;\r\n}\r\n<\/pre>\n<p>However once I did this I was \/sometimes\/ getting the return key misregistering as either p or l. I found changing the keyboard for U.S. English to another language and then back again fixed the issue for the rest of the apps execution. The hack round this I finally put in place was to restart the TextInput in this method as follows:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/* Terminates the editing session *\/\r\n- (BOOL)textFieldShouldReturn:(UITextField*)_textField\r\n{\r\n    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);\r\n    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);\r\n    SDL_StopTextInput();\r\n    SDL_StartTextInput();\r\n    return YES;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was having a couple of issues with the SDL keyboard on the iPhone. The first was that the keyboard disappears when you press enter, I didn&#8217;t want this. So I made the following change to SDL_uikitview.m: \/* Terminates the editing session *\/ &#8211; (BOOL)textFieldShouldReturn:(UITextField*)_textField { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN); SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN); \/\/SDL_StopTextInput(); return YES; } However [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-hb","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":1,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1066,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1066"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}