AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
WheelEvent.hpp
1/*
2Copyright (C) 2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_DOM_WHEELEVENT_H
17#define AEONGUI_DOM_WHEELEVENT_H
18#include "aeongui/dom/MouseEvent.hpp"
19
20namespace AeonGUI
21{
22 namespace DOM
23 {
28 {
29 double deltaX{0.0};
30 double deltaY{0.0};
31 double deltaZ{0.0};
32 unsigned long deltaMode{0};
33 };
34
41 class WheelEvent : public MouseEvent
42 {
43 public:
44 static constexpr unsigned long DOM_DELTA_PIXEL = 0x00;
45 static constexpr unsigned long DOM_DELTA_LINE = 0x01;
46 static constexpr unsigned long DOM_DELTA_PAGE = 0x02;
47
52 DLL WheelEvent ( const DOMString& type, const WheelEventInit& eventInitDict = {} );
53
56 DLL double deltaX() const;
59 DLL double deltaY() const;
62 DLL double deltaZ() const;
65 DLL unsigned long deltaMode() const;
66
67 private:
68 double m_deltaX{0.0};
69 double m_deltaY{0.0};
70 double m_deltaZ{0.0};
71 unsigned long m_deltaMode{0};
72 };
73 }
74}
75#endif
constexpr const DOMString & type() const
Get the event type.
Definition Event.hpp:73
MouseEvent(const DOMString &type, const MouseEventInit &eventInitDict={})
Construct a MouseEvent.
Definition MouseEvent.cpp:22
static constexpr unsigned long DOM_DELTA_PIXEL
Delta values are in pixels.
Definition WheelEvent.hpp:44
static constexpr unsigned long DOM_DELTA_LINE
Delta values are in lines.
Definition WheelEvent.hpp:45
static constexpr unsigned long DOM_DELTA_PAGE
Delta values are in pages.
Definition WheelEvent.hpp:46
WheelEvent(const DOMString &type, const WheelEventInit &eventInitDict={})
Construct a WheelEvent.
Definition WheelEvent.cpp:22
double deltaZ() const
Get the Z-axis scroll amount.
Definition WheelEvent.cpp:50
double deltaY() const
Get the Y-axis scroll amount.
Definition WheelEvent.cpp:46
double deltaX() const
Get the X-axis scroll amount.
Definition WheelEvent.cpp:42
unsigned long deltaMode() const
Get the unit indicator for delta values.
Definition WheelEvent.cpp:54
Initialization dictionary for MouseEvent construction.
Definition MouseEvent.hpp:31
Initialization dictionary for WheelEvent construction.
Definition WheelEvent.hpp:28
double deltaY
Scroll amount for the Y axis.
Definition WheelEvent.hpp:30
unsigned long deltaMode
Unit indicator for delta values.
Definition WheelEvent.hpp:32
double deltaX
Scroll amount for the X axis.
Definition WheelEvent.hpp:29
double deltaZ
Scroll amount for the Z axis.
Definition WheelEvent.hpp:31