I need to know when the user hits the Shift key (Soft Keyboard) in my EditText. currently, I'm using an addTextChangedListener, but it isn't called when the Shift key is pressed (though it is when any other key is pressed)
What can I do to know when the user hits the Shift key?
Thanks,
Mat
You have to use View.OnKeyListener
edit1.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(event.isShiftPressed())
{
}
return false;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With