Overte C++ Documentation
WheelEvent.h
1 //
2 // WheelEvent.h
3 // script-engine/src
4 //
5 // Created by Stephen Birarda on 2014-10-27.
6 // Copyright 2014 High Fidelity, Inc.
7 // Copyright 2023 Overte e.V.
8 //
9 // Distributed under the Apache License, Version 2.0.
10 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
11 // SPDX-License-Identifier: Apache-2.0
12 //
13 
16 
17 #ifndef hifi_WheelEvent_h
18 #define hifi_WheelEvent_h
19 
20 #include <QString>
21 #include <QWheelEvent>
22 
23 #include "ScriptValue.h"
24 
25 class ScriptEngine;
26 
28 class WheelEvent {
29 public:
30  WheelEvent();
31  WheelEvent(const QWheelEvent& event);
32 
33  static ScriptValue toScriptValue(ScriptEngine* engine, const WheelEvent& event);
34  static bool fromScriptValue(const ScriptValue& object, WheelEvent& event);
35 
36  int x;
37  int y;
38  int delta;
39  QString orientation;
40  bool isLeftButton;
41  bool isRightButton;
42  bool isMiddleButton;
43  bool isShifted;
44  bool isControl;
45  bool isMeta;
46  bool isAlt;
47 };
48 
49 Q_DECLARE_METATYPE(WheelEvent)
50 
51 #endif // hifi_WheelEvent_h
52 
Provides an engine-independent interface for a scripting engine.
Definition: ScriptEngine.h:93
[ScriptInterface] Provides an engine-independent interface for QScriptValue
Definition: ScriptValue.h:40
Represents a mouse wheel event to the scripting engine. Exposed as WheelEvent
Definition: WheelEvent.h:28