mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 09:18:45 +02:00
bubble up isAutoRepeat state for KeyEvent
This commit is contained in:
parent
da531ac25e
commit
f8b423ced6
2 changed files with 10 additions and 3 deletions
|
@ -30,7 +30,8 @@ KeyEvent::KeyEvent() :
|
||||||
isMeta(false),
|
isMeta(false),
|
||||||
isAlt(false),
|
isAlt(false),
|
||||||
isKeypad(false),
|
isKeypad(false),
|
||||||
isValid(false)
|
isValid(false),
|
||||||
|
isAutoRepeat(false)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ KeyEvent::KeyEvent(const QKeyEvent& event) {
|
||||||
isAlt = event.modifiers().testFlag(Qt::AltModifier);
|
isAlt = event.modifiers().testFlag(Qt::AltModifier);
|
||||||
isKeypad = event.modifiers().testFlag(Qt::KeypadModifier);
|
isKeypad = event.modifiers().testFlag(Qt::KeypadModifier);
|
||||||
isValid = true;
|
isValid = true;
|
||||||
|
isAutoRepeat = event.isAutoRepeat();
|
||||||
|
|
||||||
// handle special text for special characters...
|
// handle special text for special characters...
|
||||||
if (key == Qt::Key_F1) {
|
if (key == Qt::Key_F1) {
|
||||||
|
@ -127,7 +129,8 @@ bool KeyEvent::operator==(const KeyEvent& other) const {
|
||||||
&& other.isControl == isControl
|
&& other.isControl == isControl
|
||||||
&& other.isMeta == isMeta
|
&& other.isMeta == isMeta
|
||||||
&& other.isAlt == isAlt
|
&& other.isAlt == isAlt
|
||||||
&& other.isKeypad == isKeypad;
|
&& other.isKeypad == isKeypad
|
||||||
|
&& other.isAutoRepeat == isAutoRepeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,6 +166,7 @@ QScriptValue keyEventToScriptValue(QScriptEngine* engine, const KeyEvent& event)
|
||||||
obj.setProperty("isControl", event.isControl);
|
obj.setProperty("isControl", event.isControl);
|
||||||
obj.setProperty("isAlt", event.isAlt);
|
obj.setProperty("isAlt", event.isAlt);
|
||||||
obj.setProperty("isKeypad", event.isKeypad);
|
obj.setProperty("isKeypad", event.isKeypad);
|
||||||
|
obj.setProperty("isAutoRepeat", event.isAutoRepeat);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +177,7 @@ void keyEventFromScriptValue(const QScriptValue& object, KeyEvent& event) {
|
||||||
event.isControl = object.property("isControl").toVariant().toBool();
|
event.isControl = object.property("isControl").toVariant().toBool();
|
||||||
event.isAlt = object.property("isAlt").toVariant().toBool();
|
event.isAlt = object.property("isAlt").toVariant().toBool();
|
||||||
event.isKeypad = object.property("isKeypad").toVariant().toBool();
|
event.isKeypad = object.property("isKeypad").toVariant().toBool();
|
||||||
|
event.isAutoRepeat = object.property("isAutoRepeat").toVariant().toBool();
|
||||||
|
|
||||||
QScriptValue key = object.property("key");
|
QScriptValue key = object.property("key");
|
||||||
if (key.isValid()) {
|
if (key.isValid()) {
|
||||||
|
@ -286,7 +291,8 @@ void keyEventFromScriptValue(const QScriptValue& object, KeyEvent& event) {
|
||||||
<< " event.isControl=" << event.isControl
|
<< " event.isControl=" << event.isControl
|
||||||
<< " event.isMeta=" << event.isMeta
|
<< " event.isMeta=" << event.isMeta
|
||||||
<< " event.isAlt=" << event.isAlt
|
<< " event.isAlt=" << event.isAlt
|
||||||
<< " event.isKeypad=" << event.isKeypad;
|
<< " event.isKeypad=" << event.isKeypad
|
||||||
|
<< " event.isAutoRepeat=" << event.isAutoRepeat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
bool isAlt;
|
bool isAlt;
|
||||||
bool isKeypad;
|
bool isKeypad;
|
||||||
bool isValid;
|
bool isValid;
|
||||||
|
bool isAutoRepeat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue