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 4021 - Android, hard-coded Keycode value
Summary: Android, hard-coded Keycode value
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: don't know
Hardware: All Android (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-03 08:56 UTC by Sylvain
Modified: 2018-02-07 23:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain 2018-01-03 08:56:47 UTC
There is an hard-coded keycode value in SDLActivity.java


app/src/main/java/org/libsdl/app/SDLActivity.java	

@@ -1508,7 +1508,7 @@
          * as we do with physical keyboards, let's just use it to hide the keyboard.
          */
 
-        if (event.getKeyCode() == 66) {
+        if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
             String imeHide = SDLActivity.nativeGetHint("SDL_RETURN_KEY_HIDES_IME");
             if ((imeHide != null) && imeHide.equals("1")) {
                 Context c = SDL.getContext();
Comment 1 Sam Lantinga 2018-02-07 23:10:40 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/7b4cee950f96