From 82175ee871e3486f61d7fc6c06d0c5fd32e32422 Mon Sep 17 00:00:00 2001 From: krasko <154632626+krasko78@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:15:18 +0100 Subject: [PATCH] 19239: Allow accented characters to be typed in text objects with the AltGr / Ctrl+Alt keys --- src/engraving/dom/editdata.h | 2 ++ src/engraving/dom/textedit.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/engraving/dom/editdata.h b/src/engraving/dom/editdata.h index cc57d00acaddb..fa0e5f2f339cc 100644 --- a/src/engraving/dom/editdata.h +++ b/src/engraving/dom/editdata.h @@ -192,7 +192,9 @@ enum KeyboardKey { Key_BraceRight = 0x7d, Key_AsciiTilde = 0x7e, + Key_nobreakspace = 0x0a0, Key_periodcentered = 0x0b7, + Key_ydiaeresis = 0x0ff, }; enum MouseButton { diff --git a/src/engraving/dom/textedit.cpp b/src/engraving/dom/textedit.cpp index 22509f0060d8f..c39e3e181221f 100644 --- a/src/engraving/dom/textedit.cpp +++ b/src/engraving/dom/textedit.cpp @@ -392,6 +392,13 @@ bool TextBase::isEditAllowed(EditData& ed) const if (ed.key == Key_Minus) { return true; } + +#if defined(Q_OS_WIN) + // Allow accented characters to be input with AltGr and Ctrl+Alt (both are treated the same in Windows) + if (ed.key >= Key_nobreakspace && ed.key <= Key_ydiaeresis) { + return true; + } +#endif } // At least on non-macOS, sometimes ed.s is not empty even if Ctrl is pressed