Skip to content

Instantly share code, notes, and snippets.

@nezticle
Created September 28, 2013 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nezticle/6744208 to your computer and use it in GitHub Desktop.
Save nezticle/6744208 to your computer and use it in GitHub Desktop.
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
ApplicationWindow {
title: qsTr("Key Event Viewer")
width: 640
height: 480
Text {
id: outputText
anchors.fill: parent
font.pointSize: 64
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "waiting..."
}
Item {
focus: true
Keys.onPressed: {
outputText.text = event.key + " pressed";
}
Keys.onReleased: {
outputText.text = event.key + " released";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment