• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Softkeyboard with DPAD

kickwall

Lurker
I want to let a key in softkeyboard change it's color when I press a DPAD arrow key, and I have tried this:

[FONT=&quot]case KeyEvent.KEYCODE_DPAD_UP:[/FONT][FONT=&quot]
[/FONT][FONT=&quot] if (mInputView != null && mInputView.isShown()){[/FONT][FONT=&quot]
[/FONT][FONT=&quot] Key a = mInputView.getKeyboard().getKeys().get(0); [/FONT][FONT=&quot]
[/FONT][FONT=&quot] a.pressed=true;[/FONT][FONT=&quot]
[/FONT][FONT=&quot]mInputView.refreshDrawableState();[/FONT][FONT=&quot]
[/FONT]
[FONT=&quot] updateInputViewShown();

But the key in softkeyboard didn't change it's color in realtime.
It will remain pressed state after I touch the key again by mouse cursor.

How can I change the key color in realtime when I press a DPAD arrow key?
Thanks a lot!

[/FONT]
 
Back
Top Bottom