Showing the changes to libraries/script-engine/src/EventTypes.cpp (1 of 2 files). Show all
Unified · Split
| @@ -30,7 +30,8 @@ KeyEvent::KeyEvent() : · 29 unmodified lines | ||
| 30 | 30 | isMeta(false), |
| 31 | 31 | isAlt(false), |
| 32 | 32 | isKeypad(false), |
| 33 | − isValid(false) | |
| 33 | + isValid(false), | |
| 34 | + isAutoRepeat(false) | |
| 34 | 35 | { |
| 35 | 36 | }; |
| 36 | 37 | |
| @@ -44,6 +45,7 @@ KeyEvent::KeyEvent(const QKeyEvent& event) { · 7 unmodified lines | ||
| 44 | 45 | isAlt = event.modifiers().testFlag(Qt::AltModifier); |
| 45 | 46 | isKeypad = event.modifiers().testFlag(Qt::KeypadModifier); |
| 46 | 47 | isValid = true; |
| 48 | + isAutoRepeat = event.isAutoRepeat(); | |
| 47 | 49 | |
| 48 | 50 | // handle special text for special characters... |
| 49 | 51 | if (key == Qt::Key_F1) { |
| @@ -127,7 +129,8 @@ bool KeyEvent::operator==(const KeyEvent& other) const { · 77 unmodified lines | ||
| 127 | 129 | && other.isControl == isControl |
| 128 | 130 | && other.isMeta == isMeta |
| 129 | 131 | && other.isAlt == isAlt |
| 130 | − && other.isKeypad == isKeypad; | |
| 132 | + && other.isKeypad == isKeypad | |
| 133 | + && other.isAutoRepeat == isAutoRepeat; | |
| 131 | 134 | } |
| 132 | 135 | |
| 133 | 136 | |
| @@ -163,6 +166,7 @@ QScriptValue keyEventToScriptValue(QScriptEngine* engine, const KeyEvent& event) · 29 unmodified lines | ||
| 163 | 166 | obj.setProperty("isControl", event.isControl); |
| 164 | 167 | obj.setProperty("isAlt", event.isAlt); |
| 165 | 168 | obj.setProperty("isKeypad", event.isKeypad); |
| 169 | + obj.setProperty("isAutoRepeat", event.isAutoRepeat); | |
| 166 | 170 | return obj; |
| 167 | 171 | } |
| 168 | 172 | |
| @@ -173,6 +177,7 @@ void keyEventFromScriptValue(const QScriptValue& object, KeyEvent& event) { · 4 unmodified lines | ||
| 173 | 177 | event.isControl = object.property("isControl").toVariant().toBool(); |
| 174 | 178 | event.isAlt = object.property("isAlt").toVariant().toBool(); |
| 175 | 179 | event.isKeypad = object.property("isKeypad").toVariant().toBool(); |
| 180 | + event.isAutoRepeat = object.property("isAutoRepeat").toVariant().toBool(); | |
| 176 | 181 | |
| 177 | 182 | QScriptValue key = object.property("key"); |
| 178 | 183 | if (key.isValid()) { |
| @@ -286,7 +291,8 @@ void keyEventFromScriptValue(const QScriptValue& object, KeyEvent& event) { · 107 unmodified lines | ||
| 286 | 291 | << " event.isControl=" << event.isControl |
| 287 | 292 | << " event.isMeta=" << event.isMeta |
| 288 | 293 | << " event.isAlt=" << event.isAlt |
| 289 | − << " event.isKeypad=" << event.isKeypad; | |
| 294 | + << " event.isKeypad=" << event.isKeypad | |
| 295 | + << " event.isAutoRepeat=" << event.isAutoRepeat; | |
| 290 | 296 | } |
| 291 | 297 | } |
| 292 | 298 | |