mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
Find the joystick controller dynamically
This commit is contained in:
parent
3ca3c635c0
commit
8a0540234c
1 changed files with 14 additions and 1 deletions
|
@ -8,10 +8,21 @@ import "./controls"
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: root
|
id: root
|
||||||
property var xbox: NewControllers.Hardware.X360Controller1
|
|
||||||
property var actions: NewControllers.Actions
|
property var actions: NewControllers.Actions
|
||||||
property var standard: NewControllers.Standard
|
property var standard: NewControllers.Standard
|
||||||
property var testMapping: null
|
property var testMapping: null
|
||||||
|
property var xbox: null
|
||||||
|
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
var patt = /^X360Controller/;
|
||||||
|
for (var prop in NewControllers.Hardware) {
|
||||||
|
if(patt.test(prop)) {
|
||||||
|
root.xbox = NewControllers.Hardware[prop]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
spacing: 12
|
spacing: 12
|
||||||
|
|
||||||
|
@ -49,6 +60,8 @@ Column {
|
||||||
mapping.from(xbox.LT).to(standard.LT);
|
mapping.from(xbox.LT).to(standard.LT);
|
||||||
mapping.from(xbox.RT).to(standard.RT);
|
mapping.from(xbox.RT).to(standard.RT);
|
||||||
NewControllers.enableMapping("Default");
|
NewControllers.enableMapping("Default");
|
||||||
|
enabled = false;
|
||||||
|
text = "Built"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue