Last active
March 17, 2021 11:22
-
-
Save blueyed/386a0657bedc4beaeaf9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- 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