OLD | NEW |
---|---|
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 "content/browser/gamepad/gamepad_standard_mappings.h" | 5 #include "content/browser/gamepad/gamepad_standard_mappings.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 } | 226 } |
227 | 227 |
228 struct MappingData { | 228 struct MappingData { |
229 const char* const vendor_id; | 229 const char* const vendor_id; |
230 const char* const product_id; | 230 const char* const product_id; |
231 GamepadStandardMappingFunction function; | 231 GamepadStandardMappingFunction function; |
232 } AvailableMappings[] = { | 232 } AvailableMappings[] = { |
233 // http://www.linux-usb.org/usb.ids | 233 // http://www.linux-usb.org/usb.ids |
234 {"0079", "0006", MapperDragonRiseGeneric}, // DragonRise Generic USB | 234 {"0079", "0006", MapperDragonRiseGeneric}, // DragonRise Generic USB |
235 {"045e", "028e", MapperXInputStyleGamepad}, // Xbox 360 Controller | 235 {"045e", "028e", MapperXInputStyleGamepad}, // Xbox 360 Controller |
236 {"045e", | 236 {"045e", "028f", MapperXInputStyleGamepad}, // Xbox 360 Wireless Controll er |
scottmg
2015/10/25 02:40:07
Please either re-wrap this, or alternatively drop
| |
237 "028f", | 237 {"045e", "0719", MapperXInputStyleGamepad}, // Xbox 360 Wireless Controll er |
238 MapperXInputStyleGamepad}, // Xbox 360 Wireless Controller | |
239 {"046d", "c21d", MapperXInputStyleGamepad}, // Logitech F310 | 238 {"046d", "c21d", MapperXInputStyleGamepad}, // Logitech F310 |
240 {"046d", "c21e", MapperXInputStyleGamepad}, // Logitech F510 | 239 {"046d", "c21e", MapperXInputStyleGamepad}, // Logitech F510 |
241 {"046d", "c21f", MapperXInputStyleGamepad}, // Logitech F710 | 240 {"046d", "c21f", MapperXInputStyleGamepad}, // Logitech F710 |
242 {"054c", "0268", MapperPlaystationSixAxis}, // Playstation SIXAXIS | 241 {"054c", "0268", MapperPlaystationSixAxis}, // Playstation SIXAXIS |
243 {"054c", "05c4", MapperDualshock4}, // Playstation Dualshock 4 | 242 {"054c", "05c4", MapperDualshock4}, // Playstation Dualshock 4 |
244 {"0583", "2060", MapperIBuffalo}, // iBuffalo Classic | 243 {"0583", "2060", MapperIBuffalo}, // iBuffalo Classic |
245 {"0925", "0005", MapperLakeviewResearch}, // SmartJoy PLUS Adapter | 244 {"0925", "0005", MapperLakeviewResearch}, // SmartJoy PLUS Adapter |
246 {"0925", "8866", MapperLakeviewResearch}, // WiseGroup MP-8866 | 245 {"0925", "8866", MapperLakeviewResearch}, // WiseGroup MP-8866 |
247 {"0955", "7210", MapperNvShield}, // Nvidia Shield gamepad | 246 {"0955", "7210", MapperNvShield}, // Nvidia Shield gamepad |
248 {"0e8f", "0003", MapperXGEAR}, // XFXforce XGEAR PS2 Controller | 247 {"0e8f", "0003", MapperXGEAR}, // XFXforce XGEAR PS2 Controller |
249 {"18d1", "2c40", MapperADT1}, // ADT-1 Controller | 248 {"18d1", "2c40", MapperADT1}, // ADT-1 Controller |
250 {"2378", "1008", MapperOnLiveWireless}, // OnLive Controller (Bluetooth) | 249 {"2378", "1008", MapperOnLiveWireless}, // OnLive Controller (Bluetooth) |
251 {"2378", "100a", MapperOnLiveWireless}, // OnLive Controller (Wired) | 250 {"2378", "100a", MapperOnLiveWireless}, // OnLive Controller (Wired) |
252 }; | 251 }; |
253 | 252 |
254 } // namespace | 253 } // namespace |
255 | 254 |
256 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( | 255 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( |
257 const base::StringPiece& vendor_id, | 256 const base::StringPiece& vendor_id, |
258 const base::StringPiece& product_id) { | 257 const base::StringPiece& product_id) { |
259 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { | 258 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { |
260 MappingData& item = AvailableMappings[i]; | 259 MappingData& item = AvailableMappings[i]; |
261 if (vendor_id == item.vendor_id && product_id == item.product_id) | 260 if (vendor_id == item.vendor_id && product_id == item.product_id) |
262 return item.function; | 261 return item.function; |
263 } | 262 } |
264 return NULL; | 263 return NULL; |
265 } | 264 } |
266 | 265 |
267 } // namespace content | 266 } // namespace content |
OLD | NEW |