Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QKeyEvent key as string
torsten last edited by
I'm looking for an option to show a user his assigned keys.
The problem is to get a string of the key values, like Qt::CTRL to "Ctrl" or Qt::ALT to "Alt".
event->key() correctly gets the value, but event event->text() work only for characters, not for CTRL, ALT, etc..
blex last edited by
Probably, this may help.
enum Qt::KeyboardModifier contains only 7 values. Analyze the QKeyEvent::modifiers() and append the corresponding string.