on OSX, ignore text input when CMD key is down

This commit is contained in:
Mikko Sivulainen 2018-04-13 22:28:06 +03:00 committed by omar
parent 6beafe555c
commit 1554d97492

View File

@ -10093,7 +10093,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
{
// Process text input (before we check for Return because using some IME will effectively send a Return?)
// We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters.
if (!(io.KeyCtrl && !io.KeyAlt) && is_editable && !user_nav_input_start)
if (!((io.KeyCtrl && !io.KeyAlt) || (io.OptMacOSXBehaviors && io.KeySuper)) && is_editable && !user_nav_input_start)
for (int n = 0; n < IM_ARRAYSIZE(io.InputCharacters) && io.InputCharacters[n]; n++)
{
// Insert character if they pass filtering