| 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 <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 { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 struct MappingData { | 236 struct MappingData { |
| 237 const char* const vendor_id; | 237 const char* const vendor_id; |
| 238 const char* const product_id; | 238 const char* const product_id; |
| 239 GamepadStandardMappingFunction function; | 239 GamepadStandardMappingFunction function; |
| 240 } AvailableMappings[] = { | 240 } AvailableMappings[] = { |
| 241 // http://www.linux-usb.org/usb.ids | 241 // http://www.linux-usb.org/usb.ids |
| 242 {"0079", "0011", Mapper2Axes8Keys}, // 2Axes 8Keys Game Pad | 242 {"0079", "0011", Mapper2Axes8Keys}, // 2Axes 8Keys Game Pad |
| 243 {"046d", "c216", MapperLogitechDualAction}, // Logitech DualAction | 243 {"046d", "c216", MapperLogitechDualAction}, // Logitech DualAction |
| 244 {"054c", "05c4", MapperDualshock4}, // Playstation Dualshock 4 | 244 {"054c", "05c4", MapperDualshock4}, // Playstation Dualshock 4 |
| 245 {"054c", "09cc", MapperDualshock4}, // Dualshock 4 (PS4 Slim) |
| 245 {"0583", "2060", MapperIBuffalo}, // iBuffalo Classic | 246 {"0583", "2060", MapperIBuffalo}, // iBuffalo Classic |
| 246 {"0955", "7210", MapperNvShield}, // Nvidia Shield gamepad | 247 {"0955", "7210", MapperNvShield}, // Nvidia Shield gamepad |
| 247 {"0b05", "4500", MapperADT1}, // Nexus Player Controller | 248 {"0b05", "4500", MapperADT1}, // Nexus Player Controller |
| 248 {"1532", "0900", MapperRazerServal}, // Razer Serval Controller | 249 {"1532", "0900", MapperRazerServal}, // Razer Serval Controller |
| 249 {"18d1", "2c40", MapperADT1}, // ADT-1 Controller | 250 {"18d1", "2c40", MapperADT1}, // ADT-1 Controller |
| 250 {"20d6", "6271", MapperMogaPro}, // Moga Pro Controller (HID mode) | 251 {"20d6", "6271", MapperMogaPro}, // Moga Pro Controller (HID mode) |
| 251 {"2378", "1008", MapperOnLiveWireless}, // OnLive Controller (Bluetooth) | 252 {"2378", "1008", MapperOnLiveWireless}, // OnLive Controller (Bluetooth) |
| 252 {"2378", "100a", MapperOnLiveWireless}, // OnLive Controller (Wired) | 253 {"2378", "100a", MapperOnLiveWireless}, // OnLive Controller (Wired) |
| 253 {"2836", "0001", MapperOUYA}, // OUYA Controller | 254 {"2836", "0001", MapperOUYA}, // OUYA Controller |
| 254 }; | 255 }; |
| 255 | 256 |
| 256 } // namespace | 257 } // namespace |
| 257 | 258 |
| 258 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( | 259 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( |
| 259 const base::StringPiece& vendor_id, | 260 const base::StringPiece& vendor_id, |
| 260 const base::StringPiece& product_id) { | 261 const base::StringPiece& product_id) { |
| 261 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { | 262 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { |
| 262 MappingData& item = AvailableMappings[i]; | 263 MappingData& item = AvailableMappings[i]; |
| 263 if (vendor_id == item.vendor_id && product_id == item.product_id) | 264 if (vendor_id == item.vendor_id && product_id == item.product_id) |
| 264 return item.function; | 265 return item.function; |
| 265 } | 266 } |
| 266 return NULL; | 267 return NULL; |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace device | 270 } // namespace device |
| OLD | NEW |