Code for beginner #2769
Unanswered
bvrilliance
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
If you want down and left to be pressed at the same time, something like this should work: hs.hotkey.new({}, "down", function()
print("down pressed")
hs.eventtap.event.newKeyEvent("down", true):post()
hs.eventtap.event.newKeyEvent("left", true):post()
hs.eventtap.event.newKeyEvent("down", false):post()
hs.eventtap.event.newKeyEvent("left", false):post()
end)If you want it to press down THEN left, you could do something like: hs.hotkey.bind({}, "down", function()
print("down pressed")
hs.eventtap.keyStroke({}, "down", 0)
hs.eventtap.keyStroke({}, "left", 0)
end) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, can you help me to code so that when I press 'down', it results in pressing 'down'+'left'?
Beta Was this translation helpful? Give feedback.
All reactions