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
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 | |
local function keyCodeSet(keys) |
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
local events = hs.uielement.watcher | |
watchers = {} | |
function init() | |
appsWatcher = hs.application.watcher.new(handleGlobalAppEvent) | |
appsWatcher:start() | |
-- Watch any apps that already exist | |
local apps = hs.application.runningApplications() |