Skip to content

Commit

Permalink
disallow binding to KEY_ESCAPE
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw committed Sep 12, 2024
1 parent 3b01430 commit 85cb213
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/guiKeyChangeMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent &event)
{
if (!active_key.empty() && event.EventType == EET_KEY_INPUT_EVENT
&& event.KeyInput.PressedDown) {
if (event.KeyInput.Key == irr::KEY_ESCAPE) {
// Do not allow binding to the escape key
updateFormSource(fmtgettext("Binding to the Escape key is not allowed"));
return true;
}

KeyPress kp(event.KeyInput);
keymap[active_key] = kp;

Expand Down

0 comments on commit 85cb213

Please sign in to comment.