Discussion:
NativeActivity dispatchKeyEvent override receives delete event after apostrophe event
j***@gmail.com
2018-05-22 15:18:19 UTC
Permalink
I am overriding the dispatchKeyEvent function of NativeActivity in my NDK
app. I found this is the best way to easily get unicode characters for
typed events, which I propagate up to my custom C++ portable text edit
field. It all works fine, except I was puzzled that when I press the
apostrophe(') key on the soft keyboard nothing is echoed in my text edit
field. It turns out that a pair of press/release events are generated for
the apostrophe as expected, but these are followed immediately by a pair of
press/release delete key events!

I'm guessing that at some point some handler was/is auto-generating a
second apostrophe when one apostrophe is typed (cf some editors
auto-generate 2 double quotes when you type "). Then some android coder
didn't like that, couldn't fix that code, and hacked a 'fix' by
auto-generating a delete event to delete the second unwanted apostrophe.

Can anyone confirm this? Seen it before? Is there a proper fix?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/77e2a2a4-35bb-46f4-bbca-c717ab6ce386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...