Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- Do not grab global / client keys when the xev event tester window is focused.
do
local saved = {}
function xev_globalkeys_focus(c)
if c.name == 'Event Tester' then
saved.root, saved.client = root.keys(), c.keys
root.keys({})
-- Only map alt-f4.
c.keys = {awful.key({ "Mod1", }, "F4", function (c) c:kill() end)}
end
end
function xev_globalkeys_unfocus(c)
if c.name == 'Event Tester' then
root.keys(saved.root)
c.keys = saved.client
end
end
client.connect_signal("focus", xev_globalkeys_focus)
client.connect_signal("unfocus", xev_globalkeys_unfocus)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment