H Holger Behrens Member Feb 11, 2020 #1 Is it possible to detect hotkeys in a app running in background. e..g if user taps Alt+Shft+P then DoSomething
Is it possible to detect hotkeys in a app running in background. e..g if user taps Alt+Shft+P then DoSomething
Erel B4X founder Staff member Licensed User Longtime User Feb 12, 2020 #2 Check this: https://www.b4x.com/android/forum/threads/jnativehookb4j-for-intercepting-system-input-events.55826/ Upvote 0
Check this: https://www.b4x.com/android/forum/threads/jnativehookb4j-for-intercepting-system-input-events.55826/
H Holger Behrens Member Feb 15, 2020 #3 Thank you Erel. Managed to get it to work - after some Google gymnastic (my lack of knowledge and skills) Apologies for the delay in responding to you. Upvote 0
Thank you Erel. Managed to get it to work - after some Google gymnastic (my lack of knowledge and skills) Apologies for the delay in responding to you.
H Holger Behrens Member Feb 17, 2020 #4 Follow up on the above. I get "normal" keys (A,BC, etc) but the keyEvents remain silent when tapping Alt, Shift, Ctrl, and any of the non-alphabetic / numeric keys. What am I doing wrong? Upvote 0
Follow up on the above. I get "normal" keys (A,BC, etc) but the keyEvents remain silent when tapping Alt, Shift, Ctrl, and any of the non-alphabetic / numeric keys. What am I doing wrong?
R Roycefer Well-Known Member Licensed User Longtime User Feb 17, 2020 #5 We would have to see your code to better diagnose this. Upvote 0
H Holger Behrens Member Feb 18, 2020 #6 Thank you for offering to help. Here is a reduced version of my code - sufficient to illustrate the problem. TextField on form is updated with key info when key is tapped. No update to this field when shift, alt, etc is activated by user. PS: Include jNativeHookB4J.jar in library... The concept is a password manager that sits in background and is made visible when key combination is tapped. The form will show list of saved pwds (contained in secure local DB) User can now search for required user credentials or (in future) app may detect the last window/URL and provide the registered credentials to user. Or even fill in form when user opts the specified key combo... I am sure you will agree that a simple single key is not ideal for this use. I would say at least a 3 key combo (user configurable) is minimum - using alt,shift or ctrl as part of the combo. Attachments pwder 2.zip pwder 2.zip 26.7 KB · Views: 393 Upvote 0
Thank you for offering to help. Here is a reduced version of my code - sufficient to illustrate the problem. TextField on form is updated with key info when key is tapped. No update to this field when shift, alt, etc is activated by user. PS: Include jNativeHookB4J.jar in library... The concept is a password manager that sits in background and is made visible when key combination is tapped. The form will show list of saved pwds (contained in secure local DB) User can now search for required user credentials or (in future) app may detect the last window/URL and provide the registered credentials to user. Or even fill in form when user opts the specified key combo... I am sure you will agree that a simple single key is not ideal for this use. I would say at least a 3 key combo (user configurable) is minimum - using alt,shift or ctrl as part of the combo.