Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Shield Key Arrow and Space
sonichy last edited by
I am writing a program of keyboard test.
How to shield arrow keys of move between QWidgets and space of press QPushButton ?
And distinguish left and right same fuction key (Ctrl, Alt, Shift, win) ?
And distinguish numpad key ?
Pablo J. Rogina last edited by
@sonichy given that you're using standard QKeyEvent class, I'd say you may want to derive from it and create your own MyKeyEvent where you can distinguish between left and right Shift keys and so on.
You'll also may want to specialize the Qt::Key enum to add Qt::Key_Shift_L and Qt::Key_Shift_R and so on.
Then, in your mainwindow.cpp whenever you detect the left Shift key is pressed you'll use your extensions.
In any case, I wonder why you need this given that the Qt developers did not so far, and they have already abstracted the keyboard functionality of several OS...