April 2018
Beginner
714 pages
18h 21m
English
An action is represented by the Action type. An action can be triggered by pressing a single key, a key combination, or a key sequence. This is defined by the inputs property of the Action type. The most simple kind of input is ActionInput which reacts to a single key.
When the action is triggered, its active property will change from false to true. When the corresponding key or key combination is released, active changes back to false. You can use the usual QML features to track changes of the property:
Entity { //... KeyboardDevice { id: keyboardDevice } MouseDevice { id: mouseDevice } LogicalDevice { actions: [ Action { inputs: ActionInput { sourceDevice: keyboardDevice buttons: [Qt.Key_A] } onActiveChanged: ...Read now
Unlock full access