scripting additions

This commit is contained in:
ZappoMan 2014-02-18 16:47:50 -08:00
parent baa1762056
commit 866b3dbb63
2 changed files with 8 additions and 0 deletions

View file

@ -52,6 +52,10 @@ public slots:
virtual void captureWheelEvents() = 0;
virtual void releaseWheelEvents() = 0;
virtual void captureJoystick(int joystickIndex) = 0;
virtual void releaseJoystick(int joystickIndex) = 0;
virtual glm::vec2 getViewportDimensions() const = 0;
signals:
void keyPressEvent(const KeyEvent& event);

View file

@ -102,6 +102,8 @@ KeyEvent::KeyEvent(const QKeyEvent& event) {
text = "END";
} else if (key == Qt::Key_Help) {
text = "HELP";
} else if (key == Qt::Key_CapsLock) {
text = "CAPS LOCK";
}
}
@ -208,6 +210,8 @@ void keyEventFromScriptValue(const QScriptValue& object, KeyEvent& event) {
event.key = Qt::Key_End;
} else if (event.text.toUpper() == "HELP") {
event.key = Qt::Key_Help;
} else if (event.text.toUpper() == "CAPS LOCK") {
event.key = Qt::Key_CapsLock;
} else {
event.key = event.text.at(0).unicode();
}