• 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
Sep 30, 2010
1
0
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]
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones