April 2018
Beginner
714 pages
18h 21m
English
In all the previous examples, we used property change signal handlers to execute code when the state of the logical device or object picker changes. This allows you, for example, to execute a function at the moment a button is pressed or released. However, sometimes you want to execute a continuous action (for example, accelerate an object) while a button is pressed. This is easy to do with just a few changes to the code.
First, you need to attach an id to the object with interesting properties (for example Action, Axis, or ObjectPicker):
LogicalDevice { actions: [ Action { id: myAction inputs: ActionInput { sourceDevice: keyboardDevice buttons: [Qt.Key_A] } } ]}
This will allow you to refer to its properties. Next, ...
Read now
Unlock full access