On linux platform, could I set a shortcut key through QT
-
On linux platform, could I set a shortcut key through QT. Or Could I monitor combination key input.
Such as others input Ctrl and A at the same time. -
@chris_rookie
If you mean can a Qt program recognise keypresses like Ctrl plus A at the same time, and act on it, then yes.
If you mean can you write a Qt program which will recognise/change keypresses in another program, then no (so far as i am aware). -
@chris_rookie
https://doc.qt.io/qt-5/qkeyevent.html gives all the calls for recognising keypresses, including "modifiers" like Ctrl.
https://doc.qt.io/qt-5/qshortcut.html, higher level, is probably even better for you:The QShortcut class provides a way of connecting keyboard shortcuts to Qt's signals and slots mechanism, so that objects can be informed when a shortcut is executed. The shortcut can be set up to contain all the key presses necessary to describe a keyboard shortcut, including the states of modifier keys such as Shift, Ctrl, and Alt.
Then if you wanted to run another program you do that via https://doc.qt.io/qt-5/qprocess.html.