diff options
Diffstat (limited to '.hammerspoon/hyper.lua')
| -rw-r--r-- | .hammerspoon/hyper.lua | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/.hammerspoon/hyper.lua b/.hammerspoon/hyper.lua index 2124bca..4cca4db 100644 --- a/.hammerspoon/hyper.lua +++ b/.hammerspoon/hyper.lua @@ -1,23 +1,27 @@ local hyper = hs.hotkey.modal.new({}, nil) hyper.pressed = function() - hyper:enter() + hyper:enter() end hyper.released = function() - hyper:exit() + hyper:exit() end --- Bind the Hyper key to the hammerspoon modal -hs.hotkey.bind({}, "F13", hyper.pressed, hyper.released) +-- Hyper mode needs to be bound to a key. Here we are binding +-- it to F17, because this is yet another key that's unused. +-- Why not F18? We will use key-events from F18 to turn hyper +-- mode on and off. Using F17 as both the modal and source of key +-- events will result in a very jittery Hyper mode. +hs.hotkey.bind({}, "F18", hyper.pressed, hyper.released) hyper.bindApp = function(mods, key, app) - local fn = function() - hs.application.launchOrFocus(app) - end - if type(app) == "function" then - fn = app - end - hyper:bind(mods, key, fn) + local fn = function() + hs.application.launchOrFocus(app) + end + if type(app) == "function" then + fn = app + end + hyper:bind(mods, key, fn) end return hyper |
