Reputation: 2938
I have an EditText and I want to attach to it a KeyListener that accepts only hexadecimal digits. The problem is that I want to capitalize the letters and then send them to the caller, i.e return false from onKeyDown to get the normal behavior (the numbers are sent with no changes). KeyEvent has some functions for changing the action, flags, etc, but no function for changing the key code. How can I change the key code of the key event? Thanks.
Upvotes: 0
Views: 806
Reputation: 68167
Instead of taking control of keyboard's key-presses, try to make use of TextWatcher over EditText to manage inserted characters
Upvotes: 1