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] instance The instance for which this event occurred. [in] type A PP_InputEvent_Type
identifying the type of input event.[in] time_stamp A PP_TimeTicks
indicating the time when the event occurred.[in] modifiers A bit field combination of the PP_InputEvent_Modifier
flags.[in] mouse_button The 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_position A Point
containing the x and y position of the mouse when the event occurred.[in] mouse_movement The change in position of the mouse.
- Returns:
- A
PP_Resource
containing the new mouse input event.
PP_InputEvent_MouseButton(* PPB_MouseInputEvent::GetButton)(PP_Resource mouse_event) |
GetButton() returns the mouse button that generated a mouse down or up event.
- Parameters:
[in] mouse_event A 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.
int32_t(* PPB_MouseInputEvent::GetClickCount)(PP_Resource mouse_event) |
struct PP_Point(* PPB_MouseInputEvent::GetMovement)(PP_Resource mouse_event) [read] |
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_event A PP_Resource
corresponding to a mouse event.
- Returns:
- The change in position of the mouse, relative to the previous position.
struct PP_Point(* PPB_MouseInputEvent::GetPosition)(PP_Resource mouse_event) [read] |
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_event A 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.
PP_Bool(* PPB_MouseInputEvent::IsMouseInputEvent)(PP_Resource resource) |
IsMouseInputEvent() determines if a resource is a mouse event.
- Parameters:
[in] resource A PP_Resource
corresponding to an event.
- Returns:
PP_TRUE
if the given resource is a valid mouse input event, otherwisePP_FALSE
.
The documentation for this struct was generated from the following file: