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

Unified Diff: ppapi/cpp/input_event.h

Issue 7715021: Add movement information to PPB_MouseInputEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 4 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 | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/input_event.h
diff --git a/ppapi/cpp/input_event.h b/ppapi/cpp/input_event.h
index 74c9e25bc37ffe76f151e9c6e388bbb34910d42c..d64e826882839dc606307d5cb571642a42931a56 100644
--- a/ppapi/cpp/input_event.h
+++ b/ppapi/cpp/input_event.h
@@ -123,13 +123,15 @@ class MouseInputEvent : public InputEvent {
/// @param[in] click_count
/// TODO(brettw) figure out exactly what this means.
///
+ /// @param[in] mouse_movement The change in position of the mouse.
MouseInputEvent(Instance* instance,
PP_InputEvent_Type type,
PP_TimeTicks time_stamp,
uint32_t modifiers,
PP_InputEvent_MouseButton mouse_button,
const Point& mouse_position,
- int32_t click_count);
+ int32_t click_count,
+ const Point& mouse_movement);
/// GetButton() returns the mouse position for a mouse input event.
///
@@ -138,8 +140,9 @@ class MouseInputEvent : public InputEvent {
/// events, and for all non-mouse events.
PP_InputEvent_MouseButton GetButton() const;
- /// GetPostion() returns the pixel location of a mouse input event. This
- /// value is in floating-point units to support high-resolution input events.
+ /// GetPosition() returns the pixel location of a mouse input event. When
+ /// the mouse is locked, it returns the last known mouse position just as
+ /// mouse lock was entered.
///
/// @return The point associated with the mouse event, relative to the upper-
/// left of the instance receiving the event. These values can be negative for
@@ -148,6 +151,15 @@ class MouseInputEvent : public InputEvent {
// TODO(brettw) figure out exactly what this means.
int32_t GetClickCount() const;
+
+ /// Returns the change in position of the mouse. When the mouse is locked,
+ /// although the mouse position doesn't actually change, this function
+ /// still provides movement information, which indicates what the change in
+ /// position would be had the mouse not been locked.
+ ///
+ /// @return The change in position of the mouse, relative to the previous
+ /// position.
+ Point GetMovement() const;
};
class WheelInputEvent : public InputEvent {
« no previous file with comments | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698