2

I want to add an custom KEY or modify existing KEY in Android default keyboard.

I want to use that key only in my app.

how to do this? any link?

Thanks in advance.

Padma Kumar
  • 19,893
  • 17
  • 73
  • 130
Raj008
  • 3,539
  • 2
  • 28
  • 26

1 Answers1

0

This is only a walk-around. You can try to listen to key down event. Then for a particular key press, instead of original action, perform your action and tell android that you have handled it.

For example, press "Q", instead of insert an "Q", it should popup a dialog.

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_Q) {
        //popup dialog
    }
    return true; // Handled
}
Calvin
  • 3,302
  • 2
  • 32
  • 41