We are trying to build android activity that listen to any key press (either character or command) something like custom EditText
.
Windows OS
available on Android?EditText
and other controls)?EDIT
As for security, we want to get keyboard events only for our app activity, ex: when our activity is shown and focused.
The Activity's onKeyDown / up / etc method will get called if no View consumes the event.
When Views do consume the events, you will need either:
You can't listen for EditText
keys from background process, as it is bounded to Keyboard activity that manipulate that text. It will be security valuation as it will not only allow you to listen to keys in your own application but for all others, including sensitive data like user passwords.
Handling Keyboard Actions
http://developer.android.com/training/keyboard-input/commands.html
An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI.
http://developer.android.com/guide/topics/ui/ui-events.html#EventListeners
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