Data Fields

PP_Resource(* Create )(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, PP_InputEvent_MouseButton mouse_button, const struct PP_Point *mouse_position, int32_t click_count, const struct PP_Point *mouse_movement)
PP_Bool(* IsMouseInputEvent )(PP_Resource resource)
PP_InputEvent_MouseButton(* GetButton )(PP_Resource mouse_event)
struct PP_Point(* GetPosition )(PP_Resource mouse_event)
int32_t(* GetClickCount )(PP_Resource mouse_event)
struct PP_Point(* GetMovement )(PP_Resource mouse_event)

Detailed Description

The PPB_MouseInputEvent interface contains pointers to several functions related to mouse input events.


Field Documentation

PP_Resource(* PPB_MouseInputEvent::Create)(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, PP_InputEvent_MouseButton mouse_button, const struct PP_Point *mouse_position, int32_t click_count, const struct PP_Point *mouse_movement)

Create() creates a mouse input event with the given parameters.

Normally you will get a mouse event passed through the HandleInputEvent and will not need to create them, but some applications may want to create their own for internal use. The type must be one of the mouse event types.

Parameters:
[in]instanceThe instance for which this event occurred.
[in]typeA PP_InputEvent_Type identifying the type of input event.
[in]time_stampA PP_TimeTicks indicating the time when the event occurred.
[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 event occurred.
[in]mouse_movementThe change in position of the mouse.
Returns:
A PP_Resource containing the new mouse input event.

GetButton() returns the mouse button that generated a mouse down or up event.

Parameters:
[in]mouse_eventA PP_Resource corresponding to a mouse 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.

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.

Parameters:
[in]mouse_eventA PP_Resource corresponding to a mouse event.
Returns:
The change in position of the mouse, relative to the previous position.

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.

Parameters:
[in]mouse_eventA PP_Resource corresponding to a mouse event.
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.

IsMouseInputEvent() determines if a resource is a mouse event.

Parameters:
[in]resourceA PP_Resource corresponding to an event.
Returns:
PP_TRUE if the given resource is a valid mouse input event, otherwise PP_FALSE.

The documentation for this struct was generated from the following file:
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.