Monitor and synthesise macOS input events: keyboard, mouse, and scroll wheel.
All coordinate parameters use Hammerspoon screen coordinates: the origin (0, 0)
is at the top-left of the primary display and y increases downward, matching hs.screen.
Tapping events
consttap = hs.eventtap.addWatcher( [hs.eventtap.eventTypes.keyDown], (event) => { console.log("Key pressed: " + event.keyCode) returnhs.eventtap.emit// pass the event through } ) tap.start()
Suppressing events
Returning hs.eventtap.consume from the callback prevents the event from reaching
Monitor and synthesise macOS input events: keyboard, mouse, and scroll wheel. All coordinate parameters use Hammerspoon screen coordinates: the origin
(0, 0)is at the top-left of the primary display andyincreases downward, matchinghs.screen.Tapping events
Suppressing events
Returning
hs.eventtap.consumefrom the callback prevents the event from reachingSending events