Closed emiln closed 9 years ago
Perhaps jnativehook might do the trick.
Jnativehook definitely works. Just run boot -d com.1stleg/jnativehook:2.0.2 repl
and execute the following code:
(ns cljck.test
(:import [org.jnativehook GlobalScreen]
[org.jnativehook.keyboard NativeKeyListener]))
(GlobalScreen/registerNativeHook)
(GlobalScreen/addNativeKeyListener
(proxy [NativeKeyListener] []
(nativeKeyPressed [e] (println "Pressed" (.getKeyCode e)))
(nativeKeyReleased [e] (println "Released" (.getKeyCode e)))
(nativeKeyTyped [e] (println "Typed" (.getKeyCode e)))))
It's almost impossible to stop the robot if you've set up a lot of movement and clicking. It would be great to have a global keybinding that would immediately stop event processing.