Skip to content

Keypress stuff #3081

Aug 15, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

We have "press and hold" and "release" actions already for the modifier keys. If you want non-modifier keys though, you'd need to make your own "press" and "release" Lua Snippets. For the "a" key for example:

Press:

hs.eventtap.event.newKeyEvent("a", true):post()

Release:

hs.eventtap.event.newKeyEvent("a", false):post()

See: http://www.hammerspoon.org/docs/hs.eventtap.event.html#newKeyEvent

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@onetribegamingcodes
Comment options

@onetribegamingcodes
Comment options

@onetribegamingcodes
Comment options

Answer selected by latenitefilms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants