Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
Devices
Qt 3D is focused on providing a good abstraction for every aspect it handles. This applies to input as well. In terms of Qt 3D, an application may have access to an arbitrary number of physical devices. They are represented by the AbstractPhysicalDevice type. At the time of writing, there are two built-in types of physical devices: keyboard and mouse. You can access them by declaring an object of KeyboardDevice or MouseDevice type in your QML file.
You can use properties of the device object to configure its behavior. There is currently only one such property: the MouseDevice type has a sensitivity property that affects how mouse movement is converted to axis inputs.
It's allowed to create multiple objects of the same device type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access