Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_MAPPING_H_ | |
| 6 #define UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_MAPPING_H_ | |
| 7 | |
| 8 #include "ui/events/ozone/gamepad/webgamepad_constants.h" | |
| 9 | |
| 10 namespace ui { | |
| 11 | |
| 12 // The following HATX and HATY is not part of web gamepad definition, but we | |
| 13 // need to specially treat them cause HAT_Y can be mapped to DPAD_UP or | |
| 14 // DPAD_DOWN, and HAT_X can be mapped to DAPD_LEFT or DPAD_RIGHT. | |
| 15 constexpr int kHAT_X = 4; | |
| 16 constexpr int kHAT_Y = 5; | |
| 17 | |
| 18 typedef bool (*GamepadMapper)(uint16_t key, | |
| 19 uint16_t code, | |
| 20 GamepadEventType* mapped_type, | |
| 21 uint16_t* mapped_code); | |
| 22 | |
| 23 // This function get the best mapper for the gamepad vendor_id and product_id. | |
|
scottmg
2017/05/01 18:20:53
get -> gets
jkwang
2017/05/01 22:21:57
Done.
| |
| 24 GamepadMapper GetGamepadMapper(uint16_t vendor_id, uint16_t product_id); | |
| 25 | |
| 26 }; // namespace ui | |
|
scottmg
2017/05/01 18:20:53
No ;.
jkwang
2017/05/01 22:21:57
Done.
| |
| 27 | |
| 28 #endif // UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_MAPPING_H_ | |
| OLD | NEW |