Android Question Looking for the KeyCode of a Reset button

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,

I am trying to find a way to catch the KeyCode of the physical reset button which you can find on some rugged chinese phones. This to be able to try to disable it (it is situated very closed to the power button).

What I have tried was with an activity in front of me and I did press the reset button. But, as you can imagine, the reset was done just before I could catch it. Even putting a Log() it did not log something...

But the happy thing is that : if I create an app which always returns True, I am able to disable the Reset. But how could I find which code is sent ? I have tried to filter with the constants we have (excluding letters) and I was not able to find the proper code.

Edit: in the option of an app which always returns True at KeyPress, the simple fact of trying to log the KeyCode, is not quick enough to block the reset.

Many thanks for any suggestion
 
Last edited:

RandomCoder

Well-Known Member
Licensed User
Longtime User
Have you tried sending the keycodes to a messagebox instead of using the log function. By using a messagebox the program execution will be halted until you accept the message.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…