1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | InputDeviceManager {
id: deviceManager
filter: InputInfo.Mouse | InputInfo.Keyboard
onReady: {
console.log("number of devices: " + deviceManager.count)
}
onDeviceAdded: {
// does not seem to work
if (inputDevice.properties.type & InputInfo.Mouse) {
console.log("mouse added")
}
if (inputDevice.properties.type & InputInfo.Keyboard) {
console.log("keyboard added")
}
console.log(inputDevice.properties.name)
}
onDeviceRemoved: {
console.log("device removed "+deviceId)
}
}
|