Skip to content

Fixed left control and left shift not counting as modifier keys when binding - #6851

Open
dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/left-modifier-keys
Open

dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/left-modifier-keys

Conversation

@dekrom

@dekrom dekrom commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

Keybind#isKeyMod is there so a modifier key can't become the main key of a bind while another
modifier is held, which is what lets you hold Ctrl and Shift and then press the real key. It
checks KEY_LALT..KEY_RGUI, but the SDL scancodes go LCTRL 224, LSHIFT 225, LALT 226, LGUI 227,
RCTRL 228, RSHIFT 229, RALT 230, RGUI 231, so left Ctrl and left Shift fall outside the range. The
GLFW version covered all eight (GLFW_KEY_LEFT_SHIFT..GLFW_KEY_RIGHT_SUPER), the range just got
shifted in the 26.3 update.

What you see: start binding, hold Shift and tap left Ctrl, and it is bound to
"Shift + Left Control" straight away, since binding happens on release. That bind can't really
fire either, because the Ctrl press itself carries both SHIFT and CONTROL. With right Ctrl it
already waited for the next key.

Related issues

None that I found.

How Has This Been Tested?

In game with .bind, holding left Shift, tapping left Ctrl and then pressing X. Before:
"Bound to Shift + Left Control" as soon as Ctrl was released. After: "Bound to Shift + X".

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant