# Binds in Lua are not recognized

**URL:** <http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583>\
**Category:** Kerfuffle\
**Tags:** help, hyprland\
**Created:** [May 14, 2026, 7:45pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583 "2026-05-14T19:45:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shamam](http://forum.hypr.land/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@shamam](http://forum.hypr.land/u/shamam)\
**Post date:** [May 14, 2026, 7:45pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/1 "2026-05-14T19:45:14Z")

</div>

Hi,

I have recognized that binds seem to act weird when I tried to move my config to the new Lua format. The following example works fine using the .conf file, but not the .lua configuration:

Current `hyprland.conf` contains:

```auto
$mainMod = Super_L

bind = $mainMod Shift_L, C, killactive,

```

In my `hyprland.lua` configuration I use:

```lua
local mainMod = “Super_L”

hl.bind(mainMod .. " + Shift_L + C", hl.dsp.window.close())

```

Effectively, pressing the Mod key does not work - consequently none of the binds work. `wev` or `xkbcli interactive-wayland` both recognize the keysym `Super_L` properly.

Using the following on latest Arch:

```auto
hyprland -v
Hyprland 0.55.1 built from branch v0.55.1 at commit a47147bc095e5b3be3eb8bd04f0ac242b968cd4d clean ([gha] Nix: update inputs).
Date: Wed May 13 22:55:46 2026
Tag: v0.55.1, commits: 7311

Libraries:
Hyprgraphics: built against 0.5.1, system has 0.5.1
Hyprutils: built against 0.13.1, system has 0.13.1
Hyprcursor: built against 0.1.13, system has 0.1.13
Hyprlang: built against 0.6.8, system has 0.6.8
Aquamarine: built against 0.11.0, system has 0.11.0

```

---

<div class="post-metadata">

**Author:** ![bitzie](http://forum.hypr.land/user_avatar/forum.hypr.land/bitzie/32/1319_2.png) [@bitzie](http://forum.hypr.land/u/bitzie)\
**Post date:** [May 14, 2026, 9:50pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/2 "2026-05-14T21:50:23Z")

</div>

I don’t think you need the \_L for mainMod?

I have the followingin my binds.lua:

```auto
local mainMod = “SUPER”

local closeWindowBind = hl.bind(“SUPER + mouse:273”, hl.dsp.window.close())

```

---

<div class="post-metadata">

**Author:** ![shamam](http://forum.hypr.land/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@shamam](http://forum.hypr.land/u/shamam)\
**Post date:** [May 15, 2026, 2:46pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/3 "2026-05-15T14:46:57Z")

</div>

I don’t understand why omitting the `_L` should be the solution when the keysym refers to `Super_L`.

But, for what it’s worth using `local mainMod = “SUPER”` works. However, then the original window.close bind does not work as it implies a `Shift_L`:

```lua
local mainMod = “SUPER”

hl.bind(mainMod .. " + Shift_L + C", hl.dsp.window.close())

```

Therefore, the bind does not work.

Instead, using

```lua
local mainMod = “SUPER”

hl.bind(mainMod .. " + SHIFT + C", hl.dsp.window.close())

```

does work.

I am not sure if this is the intended behavior. Because it would be awesome if you could distinguish between a `Shift_L` and `Shift_R` but still be able accept both using `SHIFT`.

---

<div class="post-metadata">

**Author:** ![fishtronics](http://forum.hypr.land/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@fishtronics](http://forum.hypr.land/u/fishtronics)\
**Post date:** [May 15, 2026, 5:05pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/4 "2026-05-15T17:05:08Z")

</div>

We have modifiers and keys. A keybind has a modifier (optional) and a key.  
I am not sure if you can have 2 keys. Edit: you can have multiple keys.

Modifiers: From LuaBindingsTopLevel.cpp

```cpp
static std::optional modFromSv(std::string_view sv) {
if (sv == “SHIFT”)
return HL_MODIFIER_SHIFT;
if (sv == “CAPS”)
return HL_MODIFIER_CAPS;
if (sv == “CTRL” || sv == “CONTROL”)
return HL_MODIFIER_CTRL;
if (sv == “ALT” || sv == “MOD1”)
return HL_MODIFIER_ALT;
if (sv == “MOD2”)
return HL_MODIFIER_MOD2;
if (sv == “MOD3”)
return HL_MODIFIER_MOD3;
if (sv == “SUPER” || sv == “WIN” || sv == “LOGO” || sv == “MOD4” || sv == “META”)
return HL_MODIFIER_META;
if (sv == “MOD5”)
return HL_MODIFIER_MOD5;

return std::nullopt;

}

```

Keys: These go to xkbcommon-keysyms.h and are case insensitive i believe:

```c
// Normal keys A, B, C

// [...]

#define XKB_KEY_Shift_L 0xffe1 /* Left shift /
#define XKB_KEY_Shift_R 0xffe2 / Right shift /
#define XKB_KEY_Control_L 0xffe3 / Left control /
#define XKB_KEY_Control_R 0xffe4 / Right control /
#define XKB_KEY_Caps_Lock 0xffe5 / Caps lock /
#define XKB_KEY_Shift_Lock 0xffe6 / Shift lock */

#define XKB_KEY_Meta_L 0xffe7 /* Left meta /
#define XKB_KEY_Meta_R 0xffe8 / Right meta /
#define XKB_KEY_Alt_L 0xffe9 / Left alt /
#define XKB_KEY_Alt_R 0xffea / Right alt /
#define XKB_KEY_Super_L 0xffeb / Left super /
#define XKB_KEY_Super_R 0xffec / Right super /
#define XKB_KEY_Hyper_L 0xffed / Left hyper /
#define XKB_KEY_Hyper_R 0xffee / Right hyper */

// [...]

```

---

<div class="post-metadata">

**Author:** ![fishtronics](http://forum.hypr.land/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@fishtronics](http://forum.hypr.land/u/fishtronics)\
**Post date:** [May 15, 2026, 5:11pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/5 "2026-05-15T17:11:47Z")

</div>

Also on my machine, the bind

```lua
hl.bind("SUPER + CTRL_L", hl.dsp.window.drag(), { mouse = true })

```

from [Binds – Hyprland Wiki](https://wiki.hypr.land/Configuring/Basics/Binds/#touchpad) throws an error, as there is no XKB\_KEY\_Ctrl\_L in xkbcommon-keysyms.h

**Edit:**

If a dev reads this:

1. Please fix the wiki example to use CONTROL\_L instead of non-existing CTRL\_L.

2. I think the lua bind parser accepts binds with only modifiers, which are dead. They should be rejected with an error message.

3. I think the wiki would benefit from a list of modifiers. For example: “Valid modifiers are SUPER, SHIFT, CTRL, ALT and CAPS.”

---

<div class="post-metadata">

**Author:** ![shamam](http://forum.hypr.land/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@shamam](http://forum.hypr.land/u/shamam)\
**Post date:** [May 22, 2026, 6:56am UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/6 "2026-05-22T06:56:00Z")

</div>

Thank you all for your feedback. I am still slightly confused though 😅

Are modifiers only accepted in the ‘simple’ form as in `SHIFT` and not being recognized and distinguished between `Shift_L` / `Shift_R`?

Because certainly there seems to be an issue with how these keysyms are being parsed when using the lua approach.

---

<div class="post-metadata">

**Author:** ![Ergon](http://forum.hypr.land/user_avatar/forum.hypr.land/ergon/32/1172_2.png) [@Ergon](http://forum.hypr.land/u/Ergon)\
**Post date:** [May 22, 2026, 9:12am UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/7 "2026-05-22T09:12:46Z")

</div>

Modifiers is something different from a key, and as such handled differently.  
Super\_L is a key, SUPER is a modifier. Super\_L and Super\_R both set the SUPER flag when pressed.  
And yes, it’s possible to make hyprland handle L and R, but requires some work in the keybindmanager in the source. No one have just gotten around to it yet i guess. Open a feature request and maybe someone will pick it up.

---

<div class="post-metadata">

**Author:** ![Endurance8189](http://forum.hypr.land/letter_avatar_proxy/v4/letter/e/9fc29f/32.png) [@Endurance8189](http://forum.hypr.land/u/Endurance8189)\
**Post date:** [September 26, 2026, 8:17pm UTC](http://forum.hypr.land/t/binds-in-lua-are-not-recognized/1583/8 "2026-09-26T20:17:16Z")

</div>

> [@fishtronics](#):
>
> 1. I think the wiki would benefit from a list of modifiers. For example: “Valid modifiers are SUPER, SHIFT, CTRL, ALT and CAPS.”

I think so as well. I have been struggling to get `hl.bind("Control_L + Alt_L + L", ...)`  
to work, finally after reading a bunch of threads and then this thread I realized I can to use `CTRL + ALT + L`, as currently `_L _R` are not supported, and that those keys trigger modifiers that I can use instead.  
I would appreciate if someone could give me something to read about those modifiers 😁 🙏 Is this something hyprland specific? I didn’t know that was a thing, I thought they were behaving like normal letter keys.
