Skip to main content

Key Names

Reference for key names used in keybindings.

Modifier Keys

ModifierCommon NameDescription
"Mod4"Super/WindowsThe key with the Windows logo
"Mod1"AltLeft or Right Alt
"Shift"ShiftEither Shift key
"Control"CtrlEither Control key

Combining Modifiers

Combine modifiers in a table:

{ modkey }                -- Mod4 only
{ modkey, "Shift" } -- Mod4 + Shift
{ modkey, "Control" } -- Mod4 + Ctrl
{ "Mod1", "Shift" } -- Alt + Shift
{ modkey, "Mod1" } -- Mod4 + Alt
{ modkey, "Control", "Shift" } -- Mod4 + Ctrl + Shift

Common Key Names

KeyLua Name
Enter"Return"
Space"space"
Tab"Tab"
Escape"Escape"
Backspace"BackSpace"
Delete"Delete"
Insert"Insert"
Home"Home"
End"End"
Page Up"Prior"
Page Down"Next"

Arrow Keys

KeyLua Name
Left Arrow"Left"
Right Arrow"Right"
Up Arrow"Up"
Down Arrow"Down"

Function Keys

KeyLua Name
F1 - F12"F1" through "F12"

Letters and Numbers

KeyLua Name
Letters"a" through "z" (lowercase)
Numbers"1" through "0"

Media Keys

KeyLua Name
Volume Up"XF86AudioRaiseVolume"
Volume Down"XF86AudioLowerVolume"
Mute"XF86AudioMute"
Play/Pause"XF86AudioPlay"
Stop"XF86AudioStop"
Previous"XF86AudioPrev"
Next"XF86AudioNext"
Brightness Up"XF86MonBrightnessUp"
Brightness Down"XF86MonBrightnessDown"

Mouse Buttons

ButtonNumber
Left click1
Middle click2
Right click3
Scroll up4
Scroll down5
Scroll left6
Scroll right7
Back8
Forward9

Examples

-- Global keybinding
awful.key({ modkey }, "Return", function()
awful.spawn(terminal)
end, { description = "open terminal", group = "launcher" })

-- Keybinding with multiple modifiers
awful.key({ modkey, "Shift" }, "c", function(c)
c:kill()
end, { description = "close", group = "client" })

-- Media key (no modifier)
awful.key({}, "XF86AudioRaiseVolume", function()
awful.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+")
end, { description = "raise volume", group = "media" })

-- Mouse binding
awful.button({ modkey }, 1, function(c)
c:activate({ context = "mouse_click", action = "mouse_move" })
end)

See Also