This is an example of using @Roycefer 's jNativeHook to monitor all mouse events, even outside of the current app. It uses a ContextMenu to replicate the right click functionality. Default behaviour is overridden by the jNativeHook library and returning false from the relevant event sub.
It uses a dummy form to enable the context menu to be placed anywhere on the screen.
It's not been comprehensively tested and I can't guarantee it will work on Mac or Linux, but would be interested to know if it does.
Get the jNativehook files from here: https://www.b4x.com/android/forum/threads/jnativehookb4j-for-intercepting-system-input-events.55826/
Hope you enjoy it.
V 0.2 Update for Mac - see post #3
V 0.6 implements Tags, css styling of menu, checkmenuitem, submenus and a menutitle
V 0.7 Close all menus correctly
V 0.8 Added :
Tags : B4j Native Hook Floating Context Menu
12
It uses a dummy form to enable the context menu to be placed anywhere on the screen.
It's not been comprehensively tested and I can't guarantee it will work on Mac or Linux, but would be interested to know if it does.
Get the jNativehook files from here: https://www.b4x.com/android/forum/threads/jnativehookb4j-for-intercepting-system-input-events.55826/
Hope you enjoy it.
V 0.2 Update for Mac - see post #3
V 0.6 implements Tags, css styling of menu, checkmenuitem, submenus and a menutitle
V 0.7 Close all menus correctly
V 0.8 Added :
- Ignore clicks on window (allows window to operate normally)
- Multiple Floating Menus (Only one can be active at a time)
This update contains breaking code, MainForm has to be passed to the NativeHook initialization.
No version increment update fixed menu resize issue.
Demo only update to V0.8
V0.8.5 AddedNo version increment update fixed menu resize issue.
Demo only update to V0.8
ThRuST's latest css styles
Pause and Restart Mouse Listener
cmenu.css.zip contains the latest css.filePause and Restart Mouse Listener
Tags : B4j Native Hook Floating Context Menu
12
Attachments
Last edited: