Answer the question
In order to leave comments, you need to log in
How to remap keys in android without root?
I need to disable all standard actions on the keys when starting my application, and turn it back on when it ends. I can not require users to root the device.
PS
If anyone is wondering why this is needed: I am writing a terminal client for android that should work with a keyboard and mouse connected via USB. But a number of keys from the keyboards are perceived by the android as hardware keys on the phone case - it turns off my program and does something. For example, F1 opens the settings window. And I need to avoid this, and just get the scan code of the key in my program.
Answer the question
In order to leave comments, you need to log in
Redefine onKeyUp and write handlers there for the keys you need. If you want to disable standard processing, then return true from this method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question