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

Unified Diff: ui/events/ozone/gamepad/generic_gamepad_mapping.h

Issue 2899893003: Add generic mapping for gamepad (Closed)
Patch Set: Created 3 years, 7 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/ozone/gamepad/generic_gamepad_mapping.h
diff --git a/ui/events/ozone/gamepad/generic_gamepad_mapping.h b/ui/events/ozone/gamepad/generic_gamepad_mapping.h
new file mode 100644
index 0000000000000000000000000000000000000000..a41b60770eaf3ab262bbdda7aff7838a5a1aee8e
--- /dev/null
+++ b/ui/events/ozone/gamepad/generic_gamepad_mapping.h
@@ -0,0 +1,35 @@
+// Copyright 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_OZONE_GENERIC_GAMEPAD_GAMEPAD_MAPPING_H_
+#define UI_EVENTS_OZONE_GENERIC_GAMEPAD_GAMEPAD_MAPPING_H_
+
+#include <vector>
+#include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
+#include "ui/events/ozone/gamepad/gamepad_mapping.h"
+#include "ui/events/ozone/gamepad/webgamepad_constants.h"
+
+namespace ui {
+
+class EventDeviceInfo;
+
+class EVENTS_OZONE_EVDEV_EXPORT GenericGamepadMapping : public GamepadMapper {
+ public:
+ GenericGamepadMapping(const EventDeviceInfo& device_info);
+
+ bool operator()(uint16_t type,
+ uint16_t code,
+ GamepadEventType* mapped_type,
+ uint16_t* mapped_code) override;
spang 2017/06/01 05:08:13 const
jkwang 2017/06/02 22:03:52 Done.
+
+ ~GenericGamepadMapping() override;
+
+ private:
+ std::vector<AbsMapEntry> abs_map_;
+ std::vector<KeyMapEntry> key_map_;
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_GENERIC_GAMEPAD_GAMEPAD_MAPPING_H_

Powered by Google App Engine
This is Rietveld 408576698