Created
January 16, 2017 18:21
-
-
Save jacobthemyth/a5484213c33e2c66d52d1ce5f22b2cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://www.hammerspoon.org/docs/hs.hotkey.html | |
local function keyCode(key, modifiers) | |
modifiers = modifiers or {} | |
return function() | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post() | |
hs.timer.usleep(1000) | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post() | |
end | |
end | |
hs.hotkey.bind({'ctrl'}, 'n', keyCode('down'), nil, keyCode('down')) | |
hs.hotkey.bind({'ctrl'}, 'p', keyCode('up'), nil, keyCode('up')) | |
hs.hotkey.bind({'ctrl', 'shift'}, 'n', keyCode('down', {'shift'}), nil, keyCode('down', {'shift'})) | |
hs.hotkey.bind({'ctrl', 'shift'}, 'p', keyCode('up', {'shift'}), nil, keyCode('up', {'shift'})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment