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 | WheelEvent::WheelEvent() : | 19 | WheelEvent::WheelEvent() : |
| 20 | x(0.0f), | 20 | x(0.0f), |
| 21 | y(0.0f), | 21 | y(0.0f), |
| 22 | delta(0.0f), | 22 | deltaX(0.0f), |
| 23 | deltaY(0.0f), | ||
| 23 | orientation("UNKNOwN"), | 24 | orientation("UNKNOwN"), |
| 24 | isLeftButton(false), | 25 | isLeftButton(false), |
| 25 | isRightButton(false), | 26 | isRightButton(false), |
| @@ -42,6 +43,9 @@ WheelEvent::WheelEvent(const QWheelEvent& event) { · 16 unmodified lines | |||
| 42 | orientation = "VERTICAL"; | 43 | orientation = "VERTICAL"; |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 46 | deltaX = event.angleDelta().x(); | ||
| 47 | deltaY = event.angleDelta().y(); | ||
| 48 | |||
| 45 | // button pressed state | 49 | // button pressed state |
| 46 | isLeftButton = (event.buttons().testFlag(Qt::LeftButton)); | 50 | isLeftButton = (event.buttons().testFlag(Qt::LeftButton)); |
| 47 | isRightButton = (event.buttons().testFlag(Qt::RightButton)); | 51 | isRightButton = (event.buttons().testFlag(Qt::RightButton)); |
| @@ -60,7 +64,9 @@ WheelEvent::WheelEvent(const QWheelEvent& event) { · 12 unmodified lines | |||
| 60 | * @property {number} x - Integer x-coordinate of the event on the Interface window or HMD HUD. | 64 | * @property {number} x - Integer x-coordinate of the event on the Interface window or HMD HUD. |
| 61 | * @property {number} y - Integer y-coordinate of the event on the Interface window or HMD HUD. | 65 | * @property {number} y - Integer y-coordinate of the event on the Interface window or HMD HUD. |
| 62 | * @property {number} delta - Integer number indicating the direction and speed to scroll: positive numbers to scroll up, and | 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 | * @property {string} orientation - The orientation of the wheel: <code>"VERTICAL"</code> for a typical mouse; | 70 | * @property {string} orientation - The orientation of the wheel: <code>"VERTICAL"</code> for a typical mouse; |
| 65 | * <code>"HORIZONTAL"</code> for a "horizontal" wheel. | 71 | * <code>"HORIZONTAL"</code> for a "horizontal" wheel. |
| 66 | * @property {boolean} isLeftButton - <code>true</code> if the left button was pressed when the event was generated, otherwise | 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 | ScriptValue obj = engine->newObject(); | 92 | ScriptValue obj = engine->newObject(); |
| 87 | obj.setProperty("x", event.x); | 93 | obj.setProperty("x", event.x); |
| 88 | obj.setProperty("y", event.y); | 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 | obj.setProperty("orientation", event.orientation); | 98 | obj.setProperty("orientation", event.orientation); |
| 91 | obj.setProperty("isLeftButton", event.isLeftButton); | 99 | obj.setProperty("isLeftButton", event.isLeftButton); |
| 92 | obj.setProperty("isRightButton", event.isRightButton); | 100 | obj.setProperty("isRightButton", event.isRightButton); |