From 30051cf6b4644d9a9b1e5bc8148b4c5f1d0290fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 1 Feb 2024 13:08:09 -0300 Subject: [PATCH] Fix ctrl+alt combination for text input on Windows. --- src/eepp/ui/uicodeeditor.cpp | 5 +++-- src/eepp/ui/uiconsole.cpp | 5 +++-- src/eepp/ui/uitextinput.cpp | 5 +++-- src/modules/eterm/src/eterm/ui/uiterminal.cpp | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 116a0b5d0..fd5e8a5fd 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -914,8 +914,9 @@ Uint32 UICodeEditor::onTextInput( const TextInputEvent& event ) { Input* input = getUISceneNode()->getWindow()->getInput(); if ( ( input->isLeftAltPressed() && !event.getText().empty() && event.getText()[0] == '\t' ) || - ( input->isLeftControlPressed() && !input->isAltGrPressed() ) || input->isMetaPressed() || - input->isLeftAltPressed() ) + ( input->isLeftControlPressed() && !input->isLeftAltPressed() && + !input->isAltGrPressed() ) || + input->isMetaPressed() || input->isLeftAltPressed() ) return 0; if ( mLastExecuteEventId == getUISceneNode()->getWindow()->getInput()->getEventsSentId() ) diff --git a/src/eepp/ui/uiconsole.cpp b/src/eepp/ui/uiconsole.cpp index cad433b7e..5d1811a2f 100644 --- a/src/eepp/ui/uiconsole.cpp +++ b/src/eepp/ui/uiconsole.cpp @@ -899,8 +899,9 @@ Uint32 UIConsole::onTextInput( const TextInputEvent& event ) { Input* input = getUISceneNode()->getWindow()->getInput(); if ( ( input->isLeftAltPressed() && !event.getText().empty() && event.getText()[0] == '\t' ) || - ( input->isLeftControlPressed() && !input->isAltGrPressed() ) || input->isMetaPressed() || - input->isLeftAltPressed() ) + ( input->isLeftControlPressed() && !input->isLeftAltPressed() && + !input->isAltGrPressed() ) || + input->isMetaPressed() || input->isLeftAltPressed() ) return 0; if ( mLastExecuteEventId == getUISceneNode()->getWindow()->getInput()->getEventsSentId() ) diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 38c0355a8..b1865494a 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -789,8 +789,9 @@ Uint32 UITextInput::onTextInput( const TextInputEvent& event ) { Input* input = getUISceneNode()->getWindow()->getInput(); if ( ( input->isLeftAltPressed() && !event.getText().empty() && event.getText()[0] == '\t' ) || - ( input->isLeftControlPressed() && !input->isAltGrPressed() ) || input->isMetaPressed() || - input->isLeftAltPressed() ) + ( input->isLeftControlPressed() && !input->isLeftAltPressed() && + !input->isAltGrPressed() ) || + input->isMetaPressed() || input->isLeftAltPressed() ) return 0; if ( mLastExecuteEventId == getUISceneNode()->getWindow()->getInput()->getEventsSentId() ) diff --git a/src/modules/eterm/src/eterm/ui/uiterminal.cpp b/src/modules/eterm/src/eterm/ui/uiterminal.cpp index bc737ad22..85e6a4e14 100644 --- a/src/modules/eterm/src/eterm/ui/uiterminal.cpp +++ b/src/modules/eterm/src/eterm/ui/uiterminal.cpp @@ -421,8 +421,9 @@ Uint32 UITerminal::onTextInput( const TextInputEvent& event ) { Input* input = getUISceneNode()->getWindow()->getInput(); if ( ( input->isLeftAltPressed() && !event.getText().empty() && event.getText()[0] == '\t' ) || - ( input->isLeftControlPressed() && !input->isAltGrPressed() ) || input->isMetaPressed() || - input->isLeftAltPressed() ) + ( input->isLeftControlPressed() && !input->isLeftAltPressed() && + !input->isAltGrPressed() ) || + input->isMetaPressed() || input->isLeftAltPressed() ) return 0; mTerm->onTextInput( event.getChar() );