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 #include "content/common/gamepad_hardware_buffer.h" | 7 #include "content/common/gamepad_hardware_buffer.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 const char* const product_id; | 118 const char* const product_id; |
119 GamepadStandardMappingFunction function; | 119 GamepadStandardMappingFunction function; |
120 } AvailableMappings[] = { | 120 } AvailableMappings[] = { |
121 // http://www.linux-usb.org/usb.ids | 121 // http://www.linux-usb.org/usb.ids |
122 { "045e", "028e", MapperXInputStyleGamepad }, // Xbox 360 Controller | 122 { "045e", "028e", MapperXInputStyleGamepad }, // Xbox 360 Controller |
123 { "045e", "028f", MapperXInputStyleGamepad }, // Xbox 360 Wireless Controller | 123 { "045e", "028f", MapperXInputStyleGamepad }, // Xbox 360 Wireless Controller |
124 { "046d", "c21d", MapperXInputStyleGamepad }, // Logitech F310 | 124 { "046d", "c21d", MapperXInputStyleGamepad }, // Logitech F310 |
125 { "046d", "c21e", MapperXInputStyleGamepad }, // Logitech F510 | 125 { "046d", "c21e", MapperXInputStyleGamepad }, // Logitech F510 |
126 { "046d", "c21f", MapperXInputStyleGamepad }, // Logitech F710 | 126 { "046d", "c21f", MapperXInputStyleGamepad }, // Logitech F710 |
127 { "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS | 127 { "054c", "0268", MapperPlaystationSixAxis }, // Playstation SIXAXIS |
128 { "0925", "0005", MapperMP8866 }, // SmartJoy PLUS Adapter | |
scottmg
2012/08/13 16:26:05
Maybe rename MapperMP8866 to MapperPS2Adapter?
Hm
jpd
2012/08/14 02:13:15
Done, though I'm not sure that's the best name eit
| |
128 { "0925", "8866", MapperMP8866 }, // WiseGroup MP-8866 | 129 { "0925", "8866", MapperMP8866 }, // WiseGroup MP-8866 |
129 { "0e8f", "0003", MapperXGEAR }, // XFXforce XGEAR PS2 Controller | 130 { "0e8f", "0003", MapperXGEAR }, // XFXforce XGEAR PS2 Controller |
130 }; | 131 }; |
131 | 132 |
132 } // namespace | 133 } // namespace |
133 | 134 |
134 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( | 135 GamepadStandardMappingFunction GetGamepadStandardMappingFunction( |
135 const base::StringPiece& vendor_id, | 136 const base::StringPiece& vendor_id, |
136 const base::StringPiece& product_id) { | 137 const base::StringPiece& product_id) { |
137 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { | 138 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { |
138 MappingData& item = AvailableMappings[i]; | 139 MappingData& item = AvailableMappings[i]; |
139 if (vendor_id == item.vendor_id && product_id == item.product_id) | 140 if (vendor_id == item.vendor_id && product_id == item.product_id) |
140 return item.function; | 141 return item.function; |
141 } | 142 } |
142 return NULL; | 143 return NULL; |
143 } | 144 } |
144 | 145 |
145 } // namespace content | 146 } // namespace content |
OLD | NEW |