Native Client

pp::MouseInputEvent Class Reference

This class handles mouse events. More...

Inheritance diagram for pp::MouseInputEvent:

List of all members.

Public Functions

 MouseInputEvent ()
 MouseInputEvent (const InputEvent &event)
 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, const Point &mouse_movement)
PP_InputEvent_MouseButton GetButton () const
Point GetPosition () const
int32_t GetClickCount () const
Point GetMovement () const

Detailed Description

This class handles mouse events.


Constructor and Destructor Details

pp::MouseInputEvent::MouseInputEvent ( )

Constructs an is_null() mouse input event object.

pp::MouseInputEvent::MouseInputEvent ( const InputEvent event) [explicit]

This constructor constructs a mouse input event object from the provided generic input event.

If the given event is itself is_null() or is not a mouse input event, the mouse object will be is_null().

Parameters:
eventAn InputEvent.
pp::MouseInputEvent::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,
const Point mouse_movement 
)

This constructor manually constructs a mouse event from the provided parameters.

Parameters:
[in]instanceThe instance for which this event occured.
[in]typeA PP_InputEvent_Type identifying the type of input event.
[in]time_stampA PP_TimeTicks indicating the time when the event occured.
[in]modifiersA bit field combination of the PP_InputEvent_Modifier flags.
[in]mouse_buttonThe button that changed for mouse down or up events. This value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, enter, and leave events.
[in]mouse_positionA Point containing the x and y position of the mouse when the eent occurred.
[in]click_countTODO(brettw) figure out exactly what this means.
[in]mouse_movementThe change in position of the mouse.

Function Details

PP_InputEvent_MouseButton pp::MouseInputEvent::GetButton ( ) const

GetButton() returns the mouse position for a mouse input event.

Returns:
The mouse button associated with mouse down and up events. This value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, enter, and leave events, and for all non-mouse events.
int32_t pp::MouseInputEvent::GetClickCount ( ) const
Point pp::MouseInputEvent::GetMovement ( ) 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.

Returns:
The change in position of the mouse, relative to the previous position.

TODO(yzshen): This feature hasn't been supported yet. The returned value is always (0, 0) for system-generated mouse events (which are passed through the HandleInputEvent).

Point pp::MouseInputEvent::GetPosition ( ) const

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.

Returns:
The point associated with the mouse event, relative to the upper- left of the instance receiving the event. These values can be negative for mouse drags. The return value will be (0, 0) for non-mouse events.

The documentation for this class was generated from the following file:

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.