Find out which key would be generated if the shift modifier was pressed?
-
In a Keys.onPressed event handler:
Keys.onPressed: { console.log(event.key) // 61 }
can I find out what the event.key code would have been if the shift key was pressed?
-
@pokemonsrqt hi, that would be
Qt.ShiftModifier
Keys.onPressed: { if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier)) console.log("Shift & Enter pressed"); }
-
When the shift key is not pressed, I want to know what the event.key code would have been if the shift key had been pressed.
If you think my question is strange, I would like to add context by saying that it relates to the problem in this question: https://forum.qt.io/topic/97622/how-can-i-let-users-use-control-for-zoom-in-and-control-for-zoom-out, where the shift key does not affect the event.key code if the control key is simultaneously pressed. As a possible to solution to that problem, I would like to be able to compute what the event.key code would have been had the shift key been pressed.