1
0
Fork 0

Fix a bug with Shift+3 in the ShortcutEdit (thanks gzfuqun!)

This commit is contained in:
Duncan Ogilvie 2022-01-03 06:58:46 +01:00
parent f0712b4988
commit 1b09ed07a6
1 changed files with 5 additions and 4 deletions

View File

@ -51,10 +51,11 @@ void ShortcutEdit::keyPressEvent(QKeyEvent* event)
QString text = event->text();
// The shift modifier only counts when it is not used to type a symbol
// that is only reachable using the shift key anyway
if(modifiers.testFlag(Qt::ShiftModifier) && (text.isEmpty() ||
!text.at(0).isPrint() ||
text.at(0).isLetterOrNumber() ||
text.at(0).isSpace()))
// Fix from: https://bbs.pediy.com/thread-270394.htm
if(modifiers.testFlag(Qt::ShiftModifier) && (
((keyInt >= Qt::Key_Exclam) && (keyInt <= Qt::Key_Slash)) ||
((keyInt >= Qt::Key_Colon) && (keyInt <= Qt::Key_At)) ||
((keyInt >= Qt::Key_BracketLeft) && (keyInt <= Qt::Key_QuoteLeft))))
keyInt += Qt::SHIFT;
if(modifiers.testFlag(Qt::ControlModifier))
keyInt += Qt::CTRL;