diff --git a/WinPort/src/Backend/TTY/TTYInputSequenceParserExts.cpp b/WinPort/src/Backend/TTY/TTYInputSequenceParserExts.cpp index 4938d50c3..329211f27 100644 --- a/WinPort/src/Backend/TTY/TTYInputSequenceParserExts.cpp +++ b/WinPort/src/Backend/TTY/TTYInputSequenceParserExts.cpp @@ -378,13 +378,26 @@ size_t TTYInputSequenceParser::TryParseAsKittyEscapeSequence(const char *s, size if ((modif_state & KITTY_MOD_CAPSLOCK) && !(modif_state & KITTY_MOD_SHIFT)) { // it's weird, but kitty can not give us uppercase utf8 in caps lock mode // ("text-as-codepoints" mode should solve it, but it is not working for cyrillic chars for unknown reason) - ir.Event.KeyEvent.uChar.UnicodeChar = towupper(ir.Event.KeyEvent.uChar.UnicodeChar); + // ir.Event.KeyEvent.uChar.UnicodeChar = towupper(ir.Event.KeyEvent.uChar.UnicodeChar); + WINPORT(CharUpperBuff)(&ir.Event.KeyEvent.uChar.UnicodeChar, 1); } ir.Event.KeyEvent.bKeyDown = (event_type != KITTY_EVT_KEYUP) ? 1 : 0; ir.Event.KeyEvent.wRepeatCount = 0; + if ((ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED) || + (ir.Event.KeyEvent.dwControlKeyState & RIGHT_ALT_PRESSED)) { + switch (ir.Event.KeyEvent.wVirtualKeyCode) { + case VK_ESCAPE: case VK_DELETE: case VK_BACK: case VK_TAB: case VK_RETURN: case VK_SPACE: + break; + default: + if (ir.Event.KeyEvent.uChar.UnicodeChar > 0) { + WINPORT(CharUpperBuff)(&ir.Event.KeyEvent.uChar.UnicodeChar, 1); + } + } + } + _ir_pending.emplace_back(ir); if (!_using_extension) { diff --git a/WinPort/src/Backend/WX/wxMain.cpp b/WinPort/src/Backend/WX/wxMain.cpp index b12bf3b69..d8bc2c593 100644 --- a/WinPort/src/Backend/WX/wxMain.cpp +++ b/WinPort/src/Backend/WX/wxMain.cpp @@ -1621,8 +1621,8 @@ void WinPortPanel::OnChar( wxKeyEvent& event ) ir.Event.KeyEvent.wVirtualKeyCode = ir_tmp.Event.KeyEvent.wVirtualKeyCode; ir.Event.KeyEvent.wVirtualScanCode = ir_tmp.Event.KeyEvent.wVirtualScanCode; ir.Event.KeyEvent.dwControlKeyState = ir_tmp.Event.KeyEvent.dwControlKeyState; - ir.Event.KeyEvent.dwControlKeyState |= LEFT_ALT_PRESSED; + WINPORT(CharUpperBuff)(&ir.Event.KeyEvent.uChar.UnicodeChar, 1); } #endif @@ -1632,11 +1632,12 @@ void WinPortPanel::OnChar( wxKeyEvent& event ) ir.Event.KeyEvent.bKeyDown = FALSE; wxConsoleInputShim::Enqueue(&ir, 1); + _enqueued_in_onchar = true; + #if !defined(__WXOSX__) // avoid double up event in ResetInputState() wxKeyEvent keyEventCopy = _key_tracker.LastKeydown(); _key_tracker.OnKeyUp(keyEventCopy); - _enqueued_in_onchar = true; #endif } //event.Skip();