A
Size: a a a
A
A
S
https://www.hammerspoon.org/docs/hs.hotkey.htmlи
https://www.hammerspoon.org/docs/hs.application.watcher.html
—local bind = hs.hotkey.bind
local show = hs.alert.show
function bindPhotoshop()
bind({"alt"}, "g", function() show("Photoshop") end)
end
function bindIllustrator()
bind({"alt"}, "g", function() show("Illustrator") end)
end
function appWatcher(appName, eventType)
if eventType == hs.application.watcher.activated then
-- при активации любого приложения - очищаем все бинды
show("Clear binds")
hs.hotkey.deleteAll()
end
if appName:lower():find("illustrator") then
-- если переключились на иллюстратор - биндим его
show("Bind illustrator keys")
bindIllustrator()
end
if eventType:lower():find("photoshop") then
-- переключились на фотошоп - биндим фотошоп
show("Bind photoshop keys")
bindPhotoshop()
end
end
local watcher = hs.application.watcher.new(appWatcher)
watcher:start()S
A
S
S
S
S
hs.hotkey.deleteAll() не удаляет все бинды — будешь баловаться с активацией-деактивацией конкретных.S
A
A

S
S
S
A
A
S
S