Skip to content
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

AndroidTouchInput doesn't deal with KeyEvent.ACTION_MULTIPLE #1297

Closed
jarlure opened this issue Feb 17, 2020 · 15 comments · Fixed by #1323
Closed

AndroidTouchInput doesn't deal with KeyEvent.ACTION_MULTIPLE #1297

jarlure opened this issue Feb 17, 2020 · 15 comments · Fixed by #1323
Labels
Milestone

Comments

@jarlure
Copy link

jarlure commented Feb 17, 2020

Hey,guys!

I found the bug when I typed "你好"(=“Hello”) by keyboard's input method. Maybe chinese input method is special: If you type an "h",you get a KeyEvent with action=KeyEvent.ACTION_DOWN;But when you choose "hi" from input method tips"1.h 2.hi 3.huge 4.hf 5.Hash",you get a KeyEvent with action=KeyEvent.ACTION_MULTIPLE.
I know com.jme3.input.android.AndroidTouchInput listen to these events and it deals with KeyEvent.ACTION_DOWN in method public boolean onKey(KeyEvent event).But it regards KeyEvent.ACTION_MULTIPLE as KeyInputEvent by mistake,and lost mCharacters field.

I beg to fix it,please!
TIM图片20200217203102

@jarlure
Copy link
Author

jarlure commented Feb 17, 2020

In other word,I can get "h" on TouchEvent but get nothing instead of "hi" on KeyEvent beacuse of mCharacters field missing.

@stephengold
Copy link
Member

Thanks for the bug report.

@neph1
Copy link
Contributor

neph1 commented Apr 2, 2020

Can you provide a minimal test app for this? It would make things easier when fixing it.

@jarlure
Copy link
Author

jarlure commented Apr 2, 2020 via email

@jarlure
Copy link
Author

jarlure commented Apr 2, 2020

Here it is:https://github.com/jarlure/AndroidTouchInputTest

Can you provide a minimal test app for this? It would make things easier when fixing it.

@jarlure
Copy link
Author

jarlure commented Apr 2, 2020

debug
As shown in illustration

@neph1
Copy link
Contributor

neph1 commented Apr 3, 2020

I'm not sure how you get the word hints when bringing up JmeSystem.showSoftKeyboard(true)
I only get that when I have an EditText selected.

@jarlure
Copy link
Author

jarlure commented Apr 3, 2020

I'm not sure how you get the word hints when bringing up JmeSystem.showSoftKeyboard(true)
I only get that when I have an EditText selected.

you should install SogouInput_android_v10.6_sweb.apk ,a very popullar Chinese input app.You can find it by https://github.com/jarlure/AndroidTouchInputTest/tree/master/app/src/main/assets

@neph1
Copy link
Contributor

neph1 commented Apr 3, 2020

I can see some benefits to this, but it sounds like a very special use case. Fixing it is rather simple, but it seems difficult to test in a generic way.

@jarlure
Copy link
Author

jarlure commented Apr 3, 2020

TIM图片20200403201228
I have tested every Chinese input I know, but no one was responded by jme correctly.They all send KeyEvent.ACTION_MULTIPLE.

@jarlure
Copy link
Author

jarlure commented Apr 3, 2020

Fixing bug is better than ignore it. If we do nothing, we will lose lots of Chinese users. Think about an app that can't type any word, how disappointing! :(

@neph1
Copy link
Contributor

neph1 commented Apr 4, 2020

I have a better understanding of the problem now and have I have fixed it to the best of my abilities. But I'm having issues testing it, and I don't want to install any third party apps to do so. I have installed google's pinyin keyboard but it still shows up as QWERTY in the app. If I can't test it I might just put up a PR and hope someone else can confirm it. Or make a distribution with your test app and you can test it.

@jarlure
Copy link
Author

jarlure commented Apr 4, 2020

Thank you very much for helping us. Android default input can also show this problem, even though it doesn't have powerful hint. You could use Russian or Arabic language for test. They all send KeyEvent.ACTION_MULTIPLE. I guess all languages with non-ASCII character exist the bug in jme-android.

@jarlure
Copy link
Author

jarlure commented Apr 4, 2020

input
The picture shows that my Android default google input (Russian language) looks like.

neph1 added a commit to neph1/jmonkeyengine that referenced this issue Apr 5, 2020
neph1 added a commit to neph1/jmonkeyengine that referenced this issue Apr 5, 2020
@neph1 neph1 mentioned this issue Apr 5, 2020
@neph1
Copy link
Contributor

neph1 commented Apr 5, 2020

Thanks for the help. Using russian locale did the trick. PR created.

neph1 added a commit to neph1/jmonkeyengine that referenced this issue Apr 7, 2020
neph1 added a commit to neph1/jmonkeyengine that referenced this issue Apr 7, 2020
stephengold added a commit that referenced this issue Nov 8, 2020
* fix for #1297

* fix for #1297

* fixed line endings?

* Revert "fixed line endings?"

This reverts commit 905356a.

* fixed line endings?

* fixed line endings?

* fixed line endings?

* fixed line endings?

* Update AndroidTouchInput.java

using dos2unix

* ...

* ...

* unix2dos AndroidTouchInput.java

* undo a couple more changes not related to PR 1323

Co-authored-by: Stephen Gold <sgold@sonic.net>
@stephengold stephengold added this to the Future Release milestone Nov 9, 2020
@stephengold stephengold modified the milestones: Future Release, v3.4.0 Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants