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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/webgamepad_constants.h
diff --git a/ui/events/webgamepad_constants.h b/ui/events/webgamepad_constants.h
new file mode 100644
index 0000000000000000000000000000000000000000..db288f0ea9849d0f4947a7ed9c003619aeb70b35
--- /dev/null
+++ b/ui/events/webgamepad_constants.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_WEBGAMEPAD_CONSTANTS_H_
+#define UI_EVENTS_WEBGAMEPAD_CONSTANTS_H_
+
+namespace ui {
+
+enum WebGamepadButtonType {
+ WG_BUTTON_A = 0,
+ WG_BUTTON_B = 1,
+ WG_BUTTON_X = 2,
+ WG_BUTTON_Y = 3,
+ WG_BUTTON_L1 = 4,
+ WG_BUTTON_R1 = 5,
+ WG_BUTTON_L2 = 6,
+ WG_BUTTON_R2 = 7,
+ WG_BUTTON_SELECT = 8,
+ WG_BUTTON_START = 9,
+ WG_BUTTON_THUMBL = 10,
+ WG_BUTTON_THUMBR = 11,
+ WG_BUTTON_DPAD_UP = 12,
+ WG_BUTTON_DPAD_DOWN = 13,
+ WG_BUTTON_DPAD_LEFT = 14,
+ WG_BUTTON_DPAD_RIGHT = 15,
+ WG_BUTTON_MODE = 16
+};
+
+enum WebGamepadAbsType {
+ WG_ABS_X = 0,
+ WG_ABS_Y = 1,
+ WG_ABS_Z = 2,
+ WG_ABS_RZ = 3
+};
+
+constexpr uint16_t kWebGamepadBtnCnt = 17;
+constexpr uint16_t kWebGamepadAbsCnt = 4;
+// Following constants are used to normalize abs values to web gamepad standard.
+constexpr double kWebGamepadTriggerMin = 0.0;
+constexpr double kWebGamepadTriggerMax = 1.0;
+constexpr double kWebGamepadJoystickMin = -1.0;
+constexpr double kWebGamepadJoystickMax = 1.0;
+
+} // namespace ui
+
+#endif // UI_EVENTS_WEBGAMEPAD_CONSTANTS_H_
« 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