Skip to content

Commit

Permalink
Don't submit key down as text when ctrl-key is down on X11 and macOS.…
Browse files Browse the repository at this point in the history
… Fixes shortcut keys (eg. cut/copy/select all), see #210.
  • Loading branch information
mikke89 committed Jul 19, 2021
1 parent b1f331b commit e919f10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Samples/shell/src/macosx/InputMacOSX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ OSStatus InputMacOSX::EventHandler(EventHandlerCallRef next_handler, EventRef ev
context->ProcessKeyDown(key_identifier, key_modifier_state);

Rml::Character character = GetCharacterCode(key_identifier, key_modifier_state);
if (character != Rml::Character::Null)
if (character != Rml::Character::Null && !(key_modifier_state & Rml::Input::KM_CTRL))
context->ProcessTextInput(character);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/shell/src/x11/InputX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void InputX11::ProcessXEvent(Display* display, const XEvent& event)
context->ProcessKeyDown(key_identifier, key_modifier_state);

Rml::Character character = GetCharacterCode(key_identifier, key_modifier_state);
if (character != Rml::Character::Null)
if (character != Rml::Character::Null && !(key_modifier_state & Rml::Input::KM_CTRL))
context->ProcessTextInput(character);
}
}
Expand Down

0 comments on commit e919f10

Please sign in to comment.