Search code examples
luadebianawesome-wm

awesome-wm: Possible to to map Alt+Shift?


Using Debian (jessie) and the "awesome" window manager (3.4.15), I can't figure out how to map Ctrl+Alt to a command. I would like to switch my keyboard layout like on a windows box. This is what I do to test the mapping:

awful.key({ "Alt",},"Shift", function ()awful.util.spawn("xfce4-terminal") end),

Of course the aforementioned line us within a

globalkeys = awful.util.table.join( ...

just like the other (working) hotkeys. Has anyone managed to map Alt+Shift as a shortcut?


Solution

  • The following works for me (figured this out by experimenting + running xev and looking at its output a bit):

    awful.key({ "Mod1" }, "Shift_L", function () print("key 1") end),
    awful.key({ "Shift" }, "Alt_L", function () print("key 2") end),
    

    The first one is for when you press Alt first while the second one is for when Shift is pressed first (yup, this makes a difference; pressing Shift while "a" is pressed also does something else than the opposite order).