Developer Documentation
|
Using this interface you can react on key events. You first have to register a key (or key combination) with KeyInterface::registerKey(). Note that the log widget will contain a warning if you register a key twice or it is occupied by another plugin.
For each registered key your KeyInterface::slotKeyEvent() will be triggered when the key was pressed and the slot KeyInterface::slotKeyReleaseEvent() when the key was released. Both slots get the QKeyEvent and will contain all the modifiers that were active when the event occurred.
In OpenFlippers options tab you can view all registered keys and reassign them. The events will be mapped, such that the plugins still receive the right combination. Therefore the mapping will be completely invisible to them.
See our tutorial Implementing mouse and keyboard interaction for an example of how to use mouse and keyboard events within a plugin.
To use the KeyInterface: