Showing the changes to libraries/script-engine/src/WheelEvent.cpp (1 of 2 files). Show all
Unified · Split
| @@ -19,7 +19,8 @@ · 18 unmodified lines | ||
| 19 | 19 | WheelEvent::WheelEvent() : |
| 20 | 20 | x(0.0f), |
| 21 | 21 | y(0.0f), |
| 22 | − delta(0.0f), | |
| 22 | + deltaX(0.0f), | |
| 23 | + deltaY(0.0f), | |
| 23 | 24 | orientation("UNKNOwN"), |
| 24 | 25 | isLeftButton(false), |
| 25 | 26 | isRightButton(false), |
| @@ -42,6 +43,9 @@ WheelEvent::WheelEvent(const QWheelEvent& event) { · 16 unmodified lines | ||
| 42 | 43 | orientation = "VERTICAL"; |
| 43 | 44 | } |
| 44 | 45 | |
| 46 | + deltaX = event.angleDelta().x(); | |
| 47 | + deltaY = event.angleDelta().y(); | |
| 48 | + | |
| 45 | 49 | // button pressed state |
| 46 | 50 | isLeftButton = (event.buttons().testFlag(Qt::LeftButton)); |
| 47 | 51 | isRightButton = (event.buttons().testFlag(Qt::RightButton)); |
| @@ -60,7 +64,9 @@ WheelEvent::WheelEvent(const QWheelEvent& event) { · 12 unmodified lines | ||
| 60 | 64 | * @property {number} x - Integer x-coordinate of the event on the Interface window or HMD HUD. |
| 61 | 65 | * @property {number} y - Integer y-coordinate of the event on the Interface window or HMD HUD. |
| 62 | 66 | * @property {number} delta - Integer number indicating the direction and speed to scroll: positive numbers to scroll up, and |
| 63 | − * negative numers to scroll down. | |
| 67 | + * negative numers to scroll down. <b>Deprecated. Duplicate of <code>deltaY</code>.</b> | |
| 68 | + * @property {number} deltaX - Horizontal scroll, with negative values representing a rightwards scroll. | |
| 69 | + * @property {number} deltaY - Vertical scroll, with negative values representing a downward scroll. | |
| 64 | 70 | * @property {string} orientation - The orientation of the wheel: <code>"VERTICAL"</code> for a typical mouse; |
| 65 | 71 | * <code>"HORIZONTAL"</code> for a "horizontal" wheel. |
| 66 | 72 | * @property {boolean} isLeftButton - <code>true</code> if the left button was pressed when the event was generated, otherwise |
| @@ -86,7 +92,9 @@ ScriptValue WheelEvent::toScriptValue(ScriptEngine* engine, const WheelEvent& ev · 19 unmodified lines | ||
| 86 | 92 | ScriptValue obj = engine->newObject(); |
| 87 | 93 | obj.setProperty("x", event.x); |
| 88 | 94 | obj.setProperty("y", event.y); |
| 89 | − obj.setProperty("delta", event.delta); | |
| 95 | + obj.setProperty("delta", event.deltaY); | |
| 96 | + obj.setProperty("deltaX", event.deltaX); | |
| 97 | + obj.setProperty("deltaY", event.deltaY); | |
| 90 | 98 | obj.setProperty("orientation", event.orientation); |
| 91 | 99 | obj.setProperty("isLeftButton", event.isLeftButton); |
| 92 | 100 | obj.setProperty("isRightButton", event.isRightButton); |