Pepper_42_C++_interfaces
|
#include <input_event.h>
Public Member Functions | |
InputEvent () | |
Default constructor that creates an is_null() InputEvent object. More... | |
InputEvent (PP_Resource input_event_resource) | |
~InputEvent () | |
PP_InputEvent_Type | GetType () const |
PP_TimeTicks | GetTimeStamp () const |
uint32_t | GetModifiers () const |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
This class represents an input event resource. Normally you will get passed this object through the HandleInputEvent() function on the Instance
object.
Typically you would check the type of the event and then create the appropriate event-specific object to query the properties.
Example:
Definition at line 46 of file input_event.h.
pp::InputEvent::InputEvent | ( | ) |
Default constructor that creates an is_null() InputEvent object.
|
explicit |
This constructor constructs an input event from the provided input event resource ID. The InputEvent object will be is_null() if the given resource is not a valid input event.
[in] | input_event_resource | A input event resource ID. |
pp::InputEvent::~InputEvent | ( | ) |
uint32_t pp::InputEvent::GetModifiers | ( | ) | const |
GetModifiers() returns a bitfield indicating which modifiers were down at the time of the event. This is a combination of the flags in the PP_InputEvent_Modifier
enum.
PP_TimeTicks pp::InputEvent::GetTimeStamp | ( | ) | const |
GetTimeStamp() returns the time that the event was generated. The time will be before the current time since processing and dispatching the event has some overhead. Use this value to compare the times the user generated two events without being sensitive to variable processing time.
The return value is in time ticks, which is a monotonically increasing clock not related to the wall clock time. It will not change if the user changes their clock or daylight savings time starts, so can be reliably used to compare events. This means, however, that you can't correlate event times to a particular time of day on the system clock.
PP_TimeTicks
containing the time the event was generated. PP_InputEvent_Type pp::InputEvent::GetType | ( | ) | const |
GetType() returns the type of input event for this input event object.
PP_InputEvent_Type
if successful, PP_INPUTEVENT_TYPE_UNDEFINED if the resource is invalid.