Skip to content

KeyEvent.getCharacters() returns null instead of KEYCODE_UNKNOWN #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
derenio opened this issue Jul 29, 2013 · 1 comment
Closed

KeyEvent.getCharacters() returns null instead of KEYCODE_UNKNOWN #142

derenio opened this issue Jul 29, 2013 · 1 comment

Comments

@derenio
Copy link

derenio commented Jul 29, 2013

While testing the RST_editor example (https://github.com/kivy/kivy/tree/master/examples/RST_Editor) on HTC Desize Z I've tried to scroll loaded rst file with my trackpad and got this exception:

E/AndroidRuntime(25277): FATAL EXCEPTION: main
E/AndroidRuntime(25277): java.lang.NullPointerException
E/AndroidRuntime(25277):    at org.renpy.android.SDLSurfaceView.onKeyMultiple(SDLSurfaceView.java:1004)
E/AndroidRuntime(25277):    at org.renpy.android.SDLSurfaceView.onKeyPreIme(SDLSurfaceView.java:1047)
E/AndroidRuntime(25277):    at android.view.View.dispatchKeyEventPreIme(View.java:7179)
E/AndroidRuntime(25277):    at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:1338)
E/AndroidRuntime(25277):    at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:1338)
E/AndroidRuntime(25277):    at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:1338)
E/AndroidRuntime(25277):    at android.view.ViewRootImpl.deliverKeyEvent(ViewRootImpl.java:3608)
E/AndroidRuntime(25277):    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3163)
E/AndroidRuntime(25277):    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4294)
E/AndroidRuntime(25277):    at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2824)
E/AndroidRuntime(25277):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(25277):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(25277):    at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime(25277):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(25277):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(25277):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime(25277):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime(25277):    at dalvik.system.NativeStart.main(Native Method)

the culprit line:
https://github.com/kivy/python-for-android/blob/master/src/src/org/renpy/android/SDLSurfaceView.java#L1004

The problem might be that according to http://developer.android.com/reference/android/view/KeyEvent.html#getCharacters() the trackpad's event is an ACTION_MULTIPLE and event.getCharacters() should return KEYCODE_UNKNOWN String, instead it returns null.
This might be an issue with the Android NDK itself, in that case someone more familiar with it could post this bug on a proper tracker.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@inclement
Copy link
Member

inclement commented Sep 29, 2017

Closing as this issue relates to the old toolchain which is no longer supported. Please open a new issue if you experience this problem with the current master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants