open:hammerspoon-hotkey-bind

hammerspoon hotkey bind

function keyScript(mod, key, script)  
  hs.hotkey.bind(mod, key, function()    
    hs.osascript.applescript(script)   
    -- hs.osascript.applescript("tell application \"System Events\" to key code 123 using control down")        
    -- hs.osascript.applescript("tell application \"Mission Control\" to launch")    
  end)
end

function keybindUp(mod, key, strokeMod, strokeKey)
  hs.hotkey.bind(mod, key, nil, function()
    hs.eventtap.keyStroke(strokeMod, strokeKey)
  end)
end
  • open/hammerspoon-hotkey-bind.txt
  • Last modified: 2024/10/05 06:15
  • by 127.0.0.1