[hammerspoon] Give up on opt-esc -> esc in Safari

pull/28/head
Alpha Chen 9 years ago
parent 4265ddaa53
commit 99cd81f76b

@ -7,28 +7,17 @@ end
-- Application shortcuts -- Application shortcuts
local wf = hs.window.filter local safari_esc = hs.hotkey.new({}, "escape", function() end, function()
safari_esc = hs.hotkey.new({}, "escape", function() end, function()
if current_app():name() == "Safari" then if current_app():name() == "Safari" then
safari_opt_esc:disable()
hs.eventtap.keyStroke({"alt"}, "escape") hs.eventtap.keyStroke({"alt"}, "escape")
safari_opt_esc:enable()
end
end)
safari_opt_esc = hs.hotkey.new({"alt"}, "escape", function() end, function()
if current_app():name() == "Safari" then
safari_esc:disable()
hs.eventtap.keyStroke({}, "escape")
safari_esc:enable()
end end
end) end)
local wf = hs.window.filter
wf.new("Safari"):subscribe(wf.windowFocused, function() wf.new("Safari"):subscribe(wf.windowFocused, function()
safari_esc:enable() safari_esc:enable()
safari_opt_esc:enable()
end):subscribe(wf.windowUnfocused, function() end):subscribe(wf.windowUnfocused, function()
safari_esc:disable() safari_esc:disable()
safari_opt_esc:disable()
end) end)
-- hs.hotkey.bind({"cmd", "shift"}, "[", function() -- hs.hotkey.bind({"cmd", "shift"}, "[", function()

Loading…
Cancel
Save