1. Check out our companion app, Forums for Android! Download from Google Play

Softkeyboard with DPAD

Discussion in 'Application Development' started by kickwall, Sep 30, 2010.

  1. kickwall

    kickwall New Member
    Thread Starter

    Sep 30, 2010
    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=&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!



Share This Page