Pepper_42_C++_interfaces
|
#include <input_event.h>
Public Member Functions | |
WheelInputEvent () | |
Constructs an is_null() wheel input event object. More... | |
WheelInputEvent (const InputEvent &event) | |
WheelInputEvent (const InstanceHandle &instance, PP_TimeTicks time_stamp, uint32_t modifiers, const FloatPoint &wheel_delta, const FloatPoint &wheel_ticks, bool scroll_by_page) | |
FloatPoint | GetDelta () const |
FloatPoint | GetTicks () const |
bool | GetScrollByPage () const |
![]() | |
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... | |
Definition at line 167 of file input_event.h.
pp::WheelInputEvent::WheelInputEvent | ( | ) |
Constructs an is_null() wheel input event object.
|
explicit |
pp::WheelInputEvent::WheelInputEvent | ( | const InstanceHandle & | instance, |
PP_TimeTicks | time_stamp, | ||
uint32_t | modifiers, | ||
const FloatPoint & | wheel_delta, | ||
const FloatPoint & | wheel_ticks, | ||
bool | scroll_by_page | ||
) |
Constructs a wheel input even from the given parameters.
[in] | instance | The instance for which this event occurred. |
[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] | wheel_delta | The scroll wheel's horizontal and vertical scroll amounts. |
[in] | wheel_ticks | The number of "clicks" of the scroll wheel that have produced the event. |
[in] | scroll_by_page | When true, the user is requesting to scroll by pages. When false, the user is requesting to scroll by lines. |
FloatPoint pp::WheelInputEvent::GetDelta | ( | ) | const |
GetDelta() returns the amount vertically and horizontally the user has requested to scroll by with their mouse wheel. A scroll down or to the right (where the content moves up or left) is represented as positive values, and a scroll up or to the left (where the content moves down or right) is represented as negative values.
This amount is system dependent and will take into account the user's preferred scroll sensitivity and potentially also nonlinear acceleration based on the speed of the scrolling.
Devices will be of varying resolution. Some mice with large detents will only generate integer scroll amounts. But fractional values are also possible, for example, on some trackpads and newer mice that don't have "clicks".
bool pp::WheelInputEvent::GetScrollByPage | ( | ) | const |
GetScrollByPage() indicates if the scroll delta x/y indicates pages or lines to scroll by.
FloatPoint pp::WheelInputEvent::GetTicks | ( | ) | const |
GetTicks() returns the number of "clicks" of the scroll wheel that have produced the event. The value may have system-specific acceleration applied to it, depending on the device. The positive and negative meanings are the same as for GetDelta().
If you are scrolling, you probably want to use the delta values. These tick events can be useful if you aren't doing actual scrolling and don't want or pixel values. An example may be cycling between different items in a game.