Onscreen keyboard on Android does not send correct keycodes for second language -


I have an application with native activity.

I want to show the onscreen keyboard and hear the pressed key. When I'm typing in English, everything works fine, but when I switch the keyboard to the keyboard, I only get zero for the keycode, metastet etc.

I use this code to show the keyboard:

  Input-method manager imem = (input-method manager) activity. Gate system system service (reference. INPUT_METHOD_SERVICE); View view = activity.getWindow () .getDecorView (); Imm.showSoftInput (see, 0);   

I get a keyboard event on the inInputEvent function in the native activity:

  int32_t eventType = AInputEvent_getType (event); If (eventType == AINPUT_EVENT_TYPE_KEY) {int32_t keyAction = AKeyEvent_getAction (event); Int32_t keyCode = AKeyEvent_getKeyCode (event); Int32_t will repeat = AKeyEvent_getRepeatCount (event); Int32_t keyFlags = AKeyEvent_getFlags (event); Int32_t keyScanCode = AKeyEvent_getScanCode (event); Metatet of int32_t = AKA EventGate MetaTest (event); LOGW ("EventType = AINPUT_EVENT_TYPE_KEY, keyaction =% d, keycode =% d, repeats =% d, keyFlags =% d, keyScan =% d, keyMeta =% d", key action, keycode, repeat count, key flag, key senscode, key metatet ); }   

And I'm getting all the event parameters in the form of zero.

How can I solve it?

Documentation says:

soft input method text as Can use many more inventive methods of input, there is no guarantee that an important event will arise on any key press soft keyboard: it is left for the discretion of the IME, and in fact such incidents Is transmitted to. For any key on the soft input method, you should never rely on receiving the keys. Specifically, the default software keyboard will never send any key event to target Jelly Bean or any subsequent keyboard, and only delete the ice creams sandwich or previous target application and press some of the return key Send event for

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -