The default keyboard in ics (tested with 4.0.4) lets you "select" keys on the on-screen-keyboard using movement keys ( with a dpad or keyboard arrows). By clicking the selected key is typed in.
I'm writing a new input method that needs this functionality. I have tried some sample keyboards like the Softkeyboard example included in the sdk. But those behave differently. Pressing movement keys dose not allow to select a key on the keyboard. Instead it moves the cursor in the input area.
I've also checked out the LatinIME package but fail to find the part of code that is responsible for the desired behavior. Any insight would be helpful!
My assumption so far is that the visual representation of the selection is somehow done with state_active. At least that is my conclusion after looking at the style definition. It seems that the responsible method would be onKeyUp/onKeyDown in InputMethodService. LatinIME dose not override these methods.
edit: At this point I'm confindent that this isn't the AOSP LatinIME even though it shows up as "Android Keyboard (AOSP)". I've tested this with the android mini PCs (MK808 and UG802). It seems that they have an addition to the IME. Pressing a DPAD key with the InputView shown gives the following output:
D/LatinKeyboardView( 487): ##----- keycout = 39 ------@@@
I/LatinKeyboardView( 487): ######## index=37, y= 271 x =1107
I/LatinKeyboardView( 487): ######## index=37---action =0---code =45
D/PointerTracker( 487): -------- release old key ---------------
I/LatinKeyboardView( 487): SendKeyEvent2Touch m_iIndexCurKey=37 m_iKeyCount =39 keyCode =21
I can't find anything on google regarding this. I would like to hear suggestions on how to implement this.