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

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

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo in GamepadProviderTest Created 6 years, 10 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: 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
index 6b533ca5829c01139e70ac73145613772e14c766..7c2c10c20357e41a2cc8cc0ad69ab71ae4ec4154 100644
--- a/content/browser/gamepad/gamepad_standard_mappings.h
+++ b/content/browser/gamepad/gamepad_standard_mappings.h
@@ -6,10 +6,7 @@
#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
#include "base/strings/string_piece.h"
-
-namespace blink {
-class WebGamepad;
-}
+#include "content/common/gamepad_hardware_buffer.h"
namespace content {
@@ -56,6 +53,15 @@ enum CanonicalAxisIndex {
kNumAxes
};
+// Matches XInput's trigger deadzone
+const float kDefaultButtonPressedThreshold = 30.f/255.f;
+
+// Common mapping functions
+blink::WebGamepadButton AxisToButton(float input);
+blink::WebGamepadButton AxisNegativeAsButton(float input);
+blink::WebGamepadButton AxisPositiveAsButton(float input);
+void DpadFromAxis(blink::WebGamepad* mapped, float dir);
+
} // namespace content
#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
« no previous file with comments | « content/browser/gamepad/gamepad_provider_unittest.cc ('k') | content/browser/gamepad/gamepad_standard_mappings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698