Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: device/gamepad/gamepad_standard_mappings_mac.mm

Issue 2808093006: [Device Service] Move Gamepad Blink headers to be part of the Gamepad client library (Closed)
Patch Set: rebase and address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "device/gamepad/gamepad_standard_mappings.h" 8 #include "device/gamepad/gamepad_standard_mappings.h"
9 9
10 namespace device { 10 namespace device {
11 11
12 namespace { 12 namespace {
13 13
14 void MapperXbox360Gamepad(const blink::WebGamepad& input, 14 void MapperXbox360Gamepad(const Gamepad& input, Gamepad* mapped) {
15 blink::WebGamepad* mapped) {
16 *mapped = input; 15 *mapped = input;
17 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]); 16 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]);
18 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]); 17 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]);
19 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[9]; 18 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[9];
20 mapped->buttons[BUTTON_INDEX_START] = input.buttons[8]; 19 mapped->buttons[BUTTON_INDEX_START] = input.buttons[8];
21 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[6]; 20 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[6];
22 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[7]; 21 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[7];
23 mapped->buttons[BUTTON_INDEX_DPAD_UP] = input.buttons[11]; 22 mapped->buttons[BUTTON_INDEX_DPAD_UP] = input.buttons[11];
24 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = input.buttons[12]; 23 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = input.buttons[12];
25 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = input.buttons[13]; 24 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = input.buttons[13];
26 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = input.buttons[14]; 25 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = input.buttons[14];
27 mapped->buttons[BUTTON_INDEX_META] = input.buttons[10]; 26 mapped->buttons[BUTTON_INDEX_META] = input.buttons[10];
28 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3]; 27 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3];
29 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4]; 28 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4];
30 mapped->buttons_length = BUTTON_INDEX_COUNT; 29 mapped->buttons_length = BUTTON_INDEX_COUNT;
31 mapped->axes_length = AXIS_INDEX_COUNT; 30 mapped->axes_length = AXIS_INDEX_COUNT;
32 } 31 }
33 32
34 void MapperXboxOneHidGamepad(const blink::WebGamepad& input, 33 void MapperXboxOneHidGamepad(const Gamepad& input, Gamepad* mapped) {
35 blink::WebGamepad* mapped) {
36 *mapped = input; 34 *mapped = input;
37 35
38 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 36 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
39 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 37 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
40 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 38 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
41 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 39 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
42 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 40 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
43 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 41 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
44 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 42 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
45 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 43 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
46 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton(); 44 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton();
47 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11]; 45 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11];
48 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13]; 46 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13];
49 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14]; 47 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14];
50 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 48 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
51 DpadFromAxis(mapped, input.axes[9]); 49 DpadFromAxis(mapped, input.axes[9]);
52 50
53 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 51 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
54 mapped->axes_length = AXIS_INDEX_COUNT; 52 mapped->axes_length = AXIS_INDEX_COUNT;
55 } 53 }
56 54
57 void MapperPlaystationSixAxis(const blink::WebGamepad& input, 55 void MapperPlaystationSixAxis(const Gamepad& input, Gamepad* mapped) {
58 blink::WebGamepad* mapped) {
59 *mapped = input; 56 *mapped = input;
60 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[14]; 57 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[14];
61 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[13]; 58 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[13];
62 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[15]; 59 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[15];
63 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[12]; 60 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[12];
64 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[10]; 61 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[10];
65 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[11]; 62 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[11];
66 63
67 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = 64 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] =
68 ButtonFromButtonAndAxis(input.buttons[8], input.axes[14]); 65 ButtonFromButtonAndAxis(input.buttons[8], input.axes[14]);
(...skipping 15 matching lines...) Expand all
84 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = 81 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] =
85 ButtonFromButtonAndAxis(input.buttons[5], input.axes[11]); 82 ButtonFromButtonAndAxis(input.buttons[5], input.axes[11]);
86 83
87 mapped->buttons[BUTTON_INDEX_META] = input.buttons[16]; 84 mapped->buttons[BUTTON_INDEX_META] = input.buttons[16];
88 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 85 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
89 86
90 mapped->buttons_length = BUTTON_INDEX_COUNT; 87 mapped->buttons_length = BUTTON_INDEX_COUNT;
91 mapped->axes_length = AXIS_INDEX_COUNT; 88 mapped->axes_length = AXIS_INDEX_COUNT;
92 } 89 }
93 90
94 void MapperDualshock4(const blink::WebGamepad& input, 91 void MapperDualshock4(const Gamepad& input, Gamepad* mapped) {
95 blink::WebGamepad* mapped) {
96 enum Dualshock4Buttons { 92 enum Dualshock4Buttons {
97 DUALSHOCK_BUTTON_TOUCHPAD = BUTTON_INDEX_COUNT, 93 DUALSHOCK_BUTTON_TOUCHPAD = BUTTON_INDEX_COUNT,
98 DUALSHOCK_BUTTON_COUNT 94 DUALSHOCK_BUTTON_COUNT
99 }; 95 };
100 96
101 *mapped = input; 97 *mapped = input;
102 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1]; 98 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1];
103 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[2]; 99 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[2];
104 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[0]; 100 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[0];
105 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[3]; 101 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[3];
106 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[4]; 102 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[4];
107 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[5]; 103 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[5];
108 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 104 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
109 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 105 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
110 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[8]; 106 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[8];
111 mapped->buttons[BUTTON_INDEX_START] = input.buttons[9]; 107 mapped->buttons[BUTTON_INDEX_START] = input.buttons[9];
112 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[10]; 108 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[10];
113 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[11]; 109 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[11];
114 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12]; 110 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12];
115 mapped->buttons[DUALSHOCK_BUTTON_TOUCHPAD] = input.buttons[13]; 111 mapped->buttons[DUALSHOCK_BUTTON_TOUCHPAD] = input.buttons[13];
116 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 112 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
117 DpadFromAxis(mapped, input.axes[9]); 113 DpadFromAxis(mapped, input.axes[9]);
118 114
119 mapped->buttons_length = DUALSHOCK_BUTTON_COUNT; 115 mapped->buttons_length = DUALSHOCK_BUTTON_COUNT;
120 mapped->axes_length = AXIS_INDEX_COUNT; 116 mapped->axes_length = AXIS_INDEX_COUNT;
121 } 117 }
122 118
123 void MapperIBuffalo(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 119 void MapperIBuffalo(const Gamepad& input, Gamepad* mapped) {
124 *mapped = input; 120 *mapped = input;
125 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1]; 121 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1];
126 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[0]; 122 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[0];
127 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 123 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
128 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[2]; 124 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[2];
129 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[6]; 125 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[6];
130 mapped->buttons[BUTTON_INDEX_START] = input.buttons[7]; 126 mapped->buttons[BUTTON_INDEX_START] = input.buttons[7];
131 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4]; 127 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4];
132 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5]; 128 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5];
133 mapped->buttons[BUTTON_INDEX_DPAD_UP] = AxisNegativeAsButton(input.axes[1]); 129 mapped->buttons[BUTTON_INDEX_DPAD_UP] = AxisNegativeAsButton(input.axes[1]);
134 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = AxisPositiveAsButton(input.axes[1]); 130 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = AxisPositiveAsButton(input.axes[1]);
135 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = AxisNegativeAsButton(input.axes[0]); 131 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = AxisNegativeAsButton(input.axes[0]);
136 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = 132 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] =
137 AxisPositiveAsButton(input.axes[0]); 133 AxisPositiveAsButton(input.axes[0]);
138 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 134 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
139 mapped->axes_length = 2; 135 mapped->axes_length = 2;
140 } 136 }
141 137
142 void MapperDirectInputStyle(const blink::WebGamepad& input, 138 void MapperDirectInputStyle(const Gamepad& input, Gamepad* mapped) {
143 blink::WebGamepad* mapped) {
144 *mapped = input; 139 *mapped = input;
145 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1]; 140 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[1];
146 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[2]; 141 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[2];
147 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[0]; 142 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[0];
148 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 143 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
149 DpadFromAxis(mapped, input.axes[9]); 144 DpadFromAxis(mapped, input.axes[9]);
150 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 145 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
151 mapped->axes_length = AXIS_INDEX_COUNT; 146 mapped->axes_length = AXIS_INDEX_COUNT;
152 } 147 }
153 148
154 void MapperMacallyIShock(const blink::WebGamepad& input, 149 void MapperMacallyIShock(const Gamepad& input, Gamepad* mapped) {
155 blink::WebGamepad* mapped) {
156 enum IShockButtons { 150 enum IShockButtons {
157 ISHOCK_BUTTON_C = BUTTON_INDEX_COUNT, 151 ISHOCK_BUTTON_C = BUTTON_INDEX_COUNT,
158 ISHOCK_BUTTON_D, 152 ISHOCK_BUTTON_D,
159 ISHOCK_BUTTON_E, 153 ISHOCK_BUTTON_E,
160 ISHOCK_BUTTON_COUNT, 154 ISHOCK_BUTTON_COUNT,
161 }; 155 };
162 156
163 *mapped = input; 157 *mapped = input;
164 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[6]; 158 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[6];
165 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[5]; 159 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[5];
(...skipping 17 matching lines...) Expand all
183 mapped->buttons[ISHOCK_BUTTON_E] = input.buttons[19]; 177 mapped->buttons[ISHOCK_BUTTON_E] = input.buttons[19];
184 mapped->axes[AXIS_INDEX_LEFT_STICK_X] = input.axes[0]; 178 mapped->axes[AXIS_INDEX_LEFT_STICK_X] = input.axes[0];
185 mapped->axes[AXIS_INDEX_LEFT_STICK_Y] = input.axes[1]; 179 mapped->axes[AXIS_INDEX_LEFT_STICK_Y] = input.axes[1];
186 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = -input.axes[5]; 180 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = -input.axes[5];
187 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[6]; 181 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[6];
188 182
189 mapped->buttons_length = ISHOCK_BUTTON_COUNT; 183 mapped->buttons_length = ISHOCK_BUTTON_COUNT;
190 mapped->axes_length = AXIS_INDEX_COUNT; 184 mapped->axes_length = AXIS_INDEX_COUNT;
191 } 185 }
192 186
193 void MapperXGEAR(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 187 void MapperXGEAR(const Gamepad& input, Gamepad* mapped) {
194 *mapped = input; 188 *mapped = input;
195 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[2]; 189 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[2];
196 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 190 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
197 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[0]; 191 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[0];
198 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 192 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
199 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 193 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
200 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4]; 194 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4];
201 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5]; 195 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5];
202 DpadFromAxis(mapped, input.axes[9]); 196 DpadFromAxis(mapped, input.axes[9]);
203 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[5]; 197 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[5];
204 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[2]; 198 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[2];
205 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 199 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
206 mapped->axes_length = AXIS_INDEX_COUNT; 200 mapped->axes_length = AXIS_INDEX_COUNT;
207 } 201 }
208 202
209 void MapperSmartJoyPLUS(const blink::WebGamepad& input, 203 void MapperSmartJoyPLUS(const Gamepad& input, Gamepad* mapped) {
210 blink::WebGamepad* mapped) {
211 *mapped = input; 204 *mapped = input;
212 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[2]; 205 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[2];
213 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 206 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
214 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[0]; 207 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[0];
215 mapped->buttons[BUTTON_INDEX_START] = input.buttons[8]; 208 mapped->buttons[BUTTON_INDEX_START] = input.buttons[8];
216 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[9]; 209 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[9];
217 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 210 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
218 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 211 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
219 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4]; 212 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = input.buttons[4];
220 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5]; 213 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = input.buttons[5];
221 DpadFromAxis(mapped, input.axes[9]); 214 DpadFromAxis(mapped, input.axes[9]);
222 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 215 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
223 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 216 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
224 mapped->axes_length = AXIS_INDEX_COUNT; 217 mapped->axes_length = AXIS_INDEX_COUNT;
225 } 218 }
226 219
227 void MapperDragonRiseGeneric(const blink::WebGamepad& input, 220 void MapperDragonRiseGeneric(const Gamepad& input, Gamepad* mapped) {
228 blink::WebGamepad* mapped) {
229 *mapped = input; 221 *mapped = input;
230 DpadFromAxis(mapped, input.axes[9]); 222 DpadFromAxis(mapped, input.axes[9]);
231 mapped->axes[AXIS_INDEX_LEFT_STICK_X] = input.axes[0]; 223 mapped->axes[AXIS_INDEX_LEFT_STICK_X] = input.axes[0];
232 mapped->axes[AXIS_INDEX_LEFT_STICK_Y] = input.axes[1]; 224 mapped->axes[AXIS_INDEX_LEFT_STICK_Y] = input.axes[1];
233 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[2]; 225 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[2];
234 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 226 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
235 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 227 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
236 mapped->axes_length = AXIS_INDEX_COUNT; 228 mapped->axes_length = AXIS_INDEX_COUNT;
237 } 229 }
238 230
239 void MapperOnLiveWireless(const blink::WebGamepad& input, 231 void MapperOnLiveWireless(const Gamepad& input, Gamepad* mapped) {
240 blink::WebGamepad* mapped) {
241 *mapped = input; 232 *mapped = input;
242 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 233 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
243 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 234 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
244 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 235 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
245 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 236 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
246 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 237 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
247 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 238 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
248 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]); 239 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]);
249 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]); 240 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]);
250 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[10]; 241 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[10];
251 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11]; 242 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11];
252 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13]; 243 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13];
253 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14]; 244 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14];
254 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12]; 245 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12];
255 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3]; 246 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3];
256 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4]; 247 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4];
257 DpadFromAxis(mapped, input.axes[9]); 248 DpadFromAxis(mapped, input.axes[9]);
258 249
259 mapped->buttons_length = BUTTON_INDEX_COUNT; 250 mapped->buttons_length = BUTTON_INDEX_COUNT;
260 mapped->axes_length = AXIS_INDEX_COUNT; 251 mapped->axes_length = AXIS_INDEX_COUNT;
261 } 252 }
262 253
263 void MapperADT1(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 254 void MapperADT1(const Gamepad& input, Gamepad* mapped) {
264 *mapped = input; 255 *mapped = input;
265 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 256 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
266 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 257 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
267 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 258 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
268 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 259 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
269 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 260 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
270 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 261 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
271 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 262 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
272 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 263 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
273 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton(); 264 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton();
274 mapped->buttons[BUTTON_INDEX_START] = NullButton(); 265 mapped->buttons[BUTTON_INDEX_START] = NullButton();
275 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13]; 266 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13];
276 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14]; 267 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14];
277 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12]; 268 mapped->buttons[BUTTON_INDEX_META] = input.buttons[12];
278 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 269 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
279 DpadFromAxis(mapped, input.axes[9]); 270 DpadFromAxis(mapped, input.axes[9]);
280 271
281 mapped->buttons_length = BUTTON_INDEX_COUNT; 272 mapped->buttons_length = BUTTON_INDEX_COUNT;
282 mapped->axes_length = AXIS_INDEX_COUNT; 273 mapped->axes_length = AXIS_INDEX_COUNT;
283 } 274 }
284 275
285 void MapperNvShield(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 276 void MapperNvShield(const Gamepad& input, Gamepad* mapped) {
286 *mapped = input; 277 *mapped = input;
287 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 278 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
288 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 279 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
289 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 280 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
290 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 281 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
291 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 282 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
292 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 283 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
293 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 284 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
294 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 285 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
295 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton(); 286 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton();
296 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11]; 287 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11];
297 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13]; 288 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13];
298 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14]; 289 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14];
299 mapped->buttons[BUTTON_INDEX_META] = input.buttons[8]; 290 mapped->buttons[BUTTON_INDEX_META] = input.buttons[8];
300 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 291 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
301 DpadFromAxis(mapped, input.axes[9]); 292 DpadFromAxis(mapped, input.axes[9]);
302 293
303 mapped->buttons_length = BUTTON_INDEX_COUNT; 294 mapped->buttons_length = BUTTON_INDEX_COUNT;
304 mapped->axes_length = AXIS_INDEX_COUNT; 295 mapped->axes_length = AXIS_INDEX_COUNT;
305 } 296 }
306 297
307 void MapperOUYA(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 298 void MapperOUYA(const Gamepad& input, Gamepad* mapped) {
308 *mapped = input; 299 *mapped = input;
309 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 300 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
310 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[3]; 301 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[3];
311 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[1]; 302 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[1];
312 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[2]; 303 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[2];
313 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[4]; 304 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[4];
314 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[5]; 305 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[5];
315 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]); 306 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]);
316 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]); 307 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[5]);
317 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton(); 308 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton();
318 mapped->buttons[BUTTON_INDEX_START] = NullButton(); 309 mapped->buttons[BUTTON_INDEX_START] = NullButton();
319 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[6]; 310 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[6];
320 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[7]; 311 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[7];
321 mapped->buttons[BUTTON_INDEX_DPAD_UP] = input.buttons[8]; 312 mapped->buttons[BUTTON_INDEX_DPAD_UP] = input.buttons[8];
322 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = input.buttons[9]; 313 mapped->buttons[BUTTON_INDEX_DPAD_DOWN] = input.buttons[9];
323 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = input.buttons[10]; 314 mapped->buttons[BUTTON_INDEX_DPAD_LEFT] = input.buttons[10];
324 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = input.buttons[11]; 315 mapped->buttons[BUTTON_INDEX_DPAD_RIGHT] = input.buttons[11];
325 mapped->buttons[BUTTON_INDEX_META] = input.buttons[15]; 316 mapped->buttons[BUTTON_INDEX_META] = input.buttons[15];
326 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3]; 317 mapped->axes[AXIS_INDEX_RIGHT_STICK_X] = input.axes[3];
327 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4]; 318 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[4];
328 319
329 mapped->buttons_length = BUTTON_INDEX_COUNT; 320 mapped->buttons_length = BUTTON_INDEX_COUNT;
330 mapped->axes_length = AXIS_INDEX_COUNT; 321 mapped->axes_length = AXIS_INDEX_COUNT;
331 } 322 }
332 323
333 void MapperRazerServal(const blink::WebGamepad& input, 324 void MapperRazerServal(const Gamepad& input, Gamepad* mapped) {
334 blink::WebGamepad* mapped) {
335 *mapped = input; 325 *mapped = input;
336 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 326 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
337 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 327 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
338 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 328 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
339 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 329 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
340 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 330 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
341 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 331 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
342 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 332 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
343 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 333 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
344 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[10]; 334 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = input.buttons[10];
345 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11]; 335 mapped->buttons[BUTTON_INDEX_START] = input.buttons[11];
346 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13]; 336 mapped->buttons[BUTTON_INDEX_LEFT_THUMBSTICK] = input.buttons[13];
347 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14]; 337 mapped->buttons[BUTTON_INDEX_RIGHT_THUMBSTICK] = input.buttons[14];
348 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5]; 338 mapped->axes[AXIS_INDEX_RIGHT_STICK_Y] = input.axes[5];
349 DpadFromAxis(mapped, input.axes[9]); 339 DpadFromAxis(mapped, input.axes[9]);
350 340
351 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */ 341 mapped->buttons_length = BUTTON_INDEX_COUNT - 1; /* no meta */
352 mapped->axes_length = AXIS_INDEX_COUNT; 342 mapped->axes_length = AXIS_INDEX_COUNT;
353 } 343 }
354 344
355 void MapperMogaPro(const blink::WebGamepad& input, blink::WebGamepad* mapped) { 345 void MapperMogaPro(const Gamepad& input, Gamepad* mapped) {
356 *mapped = input; 346 *mapped = input;
357 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0]; 347 mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[0];
358 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1]; 348 mapped->buttons[BUTTON_INDEX_SECONDARY] = input.buttons[1];
359 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3]; 349 mapped->buttons[BUTTON_INDEX_TERTIARY] = input.buttons[3];
360 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4]; 350 mapped->buttons[BUTTON_INDEX_QUATERNARY] = input.buttons[4];
361 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6]; 351 mapped->buttons[BUTTON_INDEX_LEFT_SHOULDER] = input.buttons[6];
362 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7]; 352 mapped->buttons[BUTTON_INDEX_RIGHT_SHOULDER] = input.buttons[7];
363 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]); 353 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[3]);
364 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]); 354 mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[4]);
365 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton(); 355 mapped->buttons[BUTTON_INDEX_BACK_SELECT] = NullButton();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 const base::StringPiece& product_id) { 406 const base::StringPiece& product_id) {
417 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { 407 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) {
418 MappingData& item = AvailableMappings[i]; 408 MappingData& item = AvailableMappings[i];
419 if (vendor_id == item.vendor_id && product_id == item.product_id) 409 if (vendor_id == item.vendor_id && product_id == item.product_id)
420 return item.function; 410 return item.function;
421 } 411 }
422 return NULL; 412 return NULL;
423 } 413 }
424 414
425 } // namespace device 415 } // namespace device
OLDNEW
« no previous file with comments | « device/gamepad/gamepad_standard_mappings_linux.cc ('k') | device/gamepad/gamepad_standard_mappings_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698