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

Side by Side Diff: ui/events/webgamepad_constants.h

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: 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
(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_WEBGAMEPAD_CONSTANTS_H_
6 #define UI_EVENTS_WEBGAMEPAD_CONSTANTS_H_
7
8 namespace ui {
9
10 enum WebGamepadButtonType {
11 WG_BUTTON_A = 0,
12 WG_BUTTON_B = 1,
13 WG_BUTTON_X = 2,
14 WG_BUTTON_Y = 3,
15 WG_BUTTON_L1 = 4,
16 WG_BUTTON_R1 = 5,
17 WG_BUTTON_L2 = 6,
18 WG_BUTTON_R2 = 7,
19 WG_BUTTON_SELECT = 8,
20 WG_BUTTON_START = 9,
21 WG_BUTTON_THUMBL = 10,
22 WG_BUTTON_THUMBR = 11,
23 WG_BUTTON_DPAD_UP = 12,
24 WG_BUTTON_DPAD_DOWN = 13,
25 WG_BUTTON_DPAD_LEFT = 14,
26 WG_BUTTON_DPAD_RIGHT = 15,
27 WG_BUTTON_MODE = 16
28 };
29
30 enum WebGamepadAbsType {
31 WG_ABS_X = 0,
32 WG_ABS_Y = 1,
33 WG_ABS_Z = 2,
34 WG_ABS_RZ = 3
35 };
36
37 constexpr uint16_t kWebGamepadBtnCnt = 17;
38 constexpr uint16_t kWebGamepadAbsCnt = 4;
39 // Following constants are used to normalize abs values to web gamepad standard.
40 constexpr double kWebGamepadTriggerMin = 0.0;
41 constexpr double kWebGamepadTriggerMax = 1.0;
42 constexpr double kWebGamepadJoystickMin = -1.0;
43 constexpr double kWebGamepadJoystickMax = 1.0;
44
45 } // namespace ui
46
47 #endif // UI_EVENTS_WEBGAMEPAD_CONSTANTS_H_
OLDNEW
« ui/events/ozone/evdev/input_device_factory_evdev.cc ('K') | « ui/events/ozone/events_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698