The problem with my code below is that on US/UK keyboard layouts +
is generated with shift + =
, but when the user uses both the control and shift modif
You have to use Qt.ShiftModifier
for reacting on shift
key:
Item {
focus: true
Keys.onPressed: {
if ((event.key == Qt.Key_Plus) && (event.modifiers & Qt.ShiftModifier))
console.log("PRessed");
}
}
Instead of Key.onPressed
use Shortcut and its sequence property :
Shortcut {
sequence: StandardKey.ZoomIn
onActivated: zoom(true)
}
Your issue is mentionned in this section of the QKeySequence documentation.