forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
joystick_dualshock4.go
105 lines (104 loc) · 1.13 KB
/
joystick_dualshock4.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package joystick
var dualshock4Config = joystickConfig{
Name: "Dualshock4 Controller",
GUID: "2222",
Axis: []pair{
pair{
Name: "left_x",
ID: 0,
},
pair{
Name: "left_y",
ID: 1,
},
pair{
Name: "right_x",
ID: 3,
},
pair{
Name: "right_y",
ID: 4,
},
pair{
Name: "l2",
ID: 2,
},
pair{
Name: "r2",
ID: 5,
},
},
Buttons: []pair{
pair{
Name: "square",
ID: 3,
},
pair{
Name: "triangle",
ID: 2,
},
pair{
Name: "circle",
ID: 1,
},
pair{
Name: "x",
ID: 0,
},
pair{
Name: "l1",
ID: 4,
},
pair{
Name: "l2",
ID: 6,
},
pair{
Name: "r1",
ID: 5,
},
pair{
Name: "r2",
ID: 7,
},
pair{
Name: "share",
ID: 8,
},
pair{
Name: "options",
ID: 9,
},
pair{
Name: "home",
ID: 10,
},
},
Hats: []hat{
hat{
Hat: 0,
Name: "down",
ID: 4,
},
hat{
Hat: 0,
Name: "up",
ID: 1,
},
hat{
Hat: 0,
Name: "left",
ID: 8,
},
hat{
Hat: 0,
Name: "right",
ID: 2,
},
hat{
Hat: 0,
Name: "released",
ID: 0,
},
},
}