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

Unified Diff: content/browser/gamepad/gamepad_standard_mappings.h

Issue 9270015: Add Mac gamepad input remapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux Created 8 years, 11 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
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_standard_mappings_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/gamepad_standard_mappings.h
diff --git a/content/browser/gamepad/gamepad_standard_mappings.h b/content/browser/gamepad/gamepad_standard_mappings.h
new file mode 100644
index 0000000000000000000000000000000000000000..35b01f88b44135ffabd7be405a442d4f0e9eae3b
--- /dev/null
+++ b/content/browser/gamepad/gamepad_standard_mappings.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 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 CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
+#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
+
+#include "base/string_piece.h"
+
+namespace WebKit {
+class WebGamepad;
+}
+
+namespace content {
+
+typedef void (*GamepadStandardMappingFunction)(
+ const WebKit::WebGamepad& original,
+ WebKit::WebGamepad* mapped);
+
+GamepadStandardMappingFunction GetGamepadStandardMappingFunction(
+ const base::StringPiece& vendor_id,
+ const base::StringPiece& product_id);
+
+// This defines our canonical mapping order for gamepad-like devices. If these
+// items cannot all be satisfied, it is a case-by-case judgement as to whether
+// it is better to leave the device unmapped, or to partially map it. In
+// general, err towards leaving it *unmapped* so that content can handle
+// appropriately.
+
+enum CanonicalButtonIndex {
+ kButtonPrimary,
+ kButtonSecondary,
+ kButtonTertiary,
+ kButtonQuaternary,
+ kButtonLeftShoulder,
+ kButtonRightShoulder,
+ kButtonLeftTrigger,
+ kButtonRightTrigger,
+ kButtonBackSelect,
+ kButtonStart,
+ kButtonLeftThumbstick,
+ kButtonRightThumbstick,
+ kButtonDpadUp,
+ kButtonDpadDown,
+ kButtonDpadLeft,
+ kButtonDpadRight,
+ kButtonMeta,
+ kNumButtons
+};
+
+enum CanonicalAxisIndex {
+ kAxisLeftStickX,
+ kAxisLeftStickY,
+ kAxisRightStickX,
+ kAxisRightStickY,
+ kNumAxes
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_standard_mappings_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698