Magnum::Platform::Sdl2Application::PointerEvent class new in Git master

Pointer event.

Base classes

class InputEvent
Base for input events.

Constructors, destructors, conversion operators

PointerEvent(const PointerEvent&) deleted
Copying is not allowed.
PointerEvent(PointerEvent&&) deleted
Moving is not allowed.

Public functions

auto operator=(const PointerEvent&) -> PointerEvent& deleted
Copying is not allowed.
auto operator=(PointerEvent&&) -> PointerEvent& deleted
Moving is not allowed.
auto source() const -> PointerEventSource
Pointer event source.
auto pointer() const -> Pointer
Pointer type that was pressed or released.
auto isPrimary() const -> bool
Whether the pointer is primary.
auto id() const -> Long
Pointer ID.
auto position() const -> Vector2
Position.
auto clickCount() const -> Int
Click count.
auto modifiers() -> Sdl2Application::Modifiers
Keyboard modifiers.

Function documentation

bool Magnum::Platform::Sdl2Application::PointerEvent::isPrimary() const

Whether the pointer is primary.

Useful to distinguish among multiple pointers in a multi-touch scenario. See Touch input in SDL2 for more information.

Long Magnum::Platform::Sdl2Application::PointerEvent::id() const

Pointer ID.

Useful to distinguish among multiple pointers in a multi-touch scenario. See Touch input in SDL2 for more information.

Vector2 Magnum::Platform::Sdl2Application::PointerEvent::position() const

Position.

For mouse input the position is always reported in whole pixels. For Pointer::Finger the events may be reported with a subpixel precision, use Math::round() to snap them to the nearest pixel. Note that, unlike the SDL_TouchFingerEvent, which is normalized in the $ [0, 1] $ range, the position for touch events is in the same coordinate system as mouse events.

Int Magnum::Platform::Sdl2Application::PointerEvent::clickCount() const

Click count.

For Pointer::Finger is always 1.

Sdl2Application::Modifiers Magnum::Platform::Sdl2Application::PointerEvent::modifiers()

Keyboard modifiers.

Lazily populated on first request.