opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
mouse_wheel_event.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace osc
9{
10 // Represents a motion of a mouse wheel or similar (e.g. double-fingered scroll
11 // on a touch screen) event.
12 class MouseWheelEvent final : public Event {
13 public:
16 delta_{delta},
17 input_source_{input_source}
18 {}
19
20 MouseInputSource input_source() const { return input_source_; }
21
22 // Returns the "delta" introduced by the wheel event. With typical
23 // mouse wheels, this almost always translates to `{0.0f, -1.0f}`
24 // when scrolling down and `{0.0f, +1.0f}` when scrolling up.
25 Vector2 delta() const { return delta_; }
26 private:
27 Vector2 delta_;
29 };
30}
Definition event.h:13
Definition mouse_wheel_event.h:12
MouseWheelEvent(Vector2 delta, MouseInputSource input_source)
Definition mouse_wheel_event.h:14
MouseInputSource input_source() const
Definition mouse_wheel_event.h:20
Vector2 delta() const
Definition mouse_wheel_event.h:25
Definition custom_decoration_generator.h:5
EventType
Definition event_type.h:7
MouseInputSource
Definition mouse_input_source.h:5
constexpr U to(T &&value)
Definition conversion.h:56