Skip to content

Commit

Permalink
19239: Allow accented characters to be typed in text objects with the…
Browse files Browse the repository at this point in the history
… AltGr / Ctrl+Alt keys
  • Loading branch information
krasko78 committed Jan 10, 2025
1 parent 7020aab commit 31e2cc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engraving/dom/editdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ enum KeyboardKey {
Key_BraceRight = 0x7d,
Key_AsciiTilde = 0x7e,

Key_nobreakspace = 0x0a0,
Key_periodcentered = 0x0b7,
Key_ydiaeresis = 0x0ff,
};

enum MouseButton {
Expand Down
7 changes: 7 additions & 0 deletions src/engraving/dom/textedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31e2cc6

Please sign in to comment.