mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 18:06:22 +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 {
|
||||
id: root
|
||||
property var xbox: NewControllers.Hardware.X360Controller1
|
||||
property var actions: NewControllers.Actions
|
||||
property var standard: NewControllers.Standard
|
||||
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
|
||||
|
||||
|
@ -49,6 +60,8 @@ Column {
|
|||
mapping.from(xbox.LT).to(standard.LT);
|
||||
mapping.from(xbox.RT).to(standard.RT);
|
||||
NewControllers.enableMapping("Default");
|
||||
enabled = false;
|
||||
text = "Built"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue