summaryrefslogtreecommitdiff
path: root/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
blob: aedccd9a247d6e54244ed8fb33844bb679542eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import QtQuick 1.0

Item {
    focus: true
    Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
    Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; }
    Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers)
    Keys.onDigit0Pressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
    Keys.onDigit9Pressed: { event.accepted = false; keysTestObject.keyPress(event.key, event.text, event.modifiers) }
    Keys.onTabPressed: keysTestObject.keyPress(event.key, "Tab", event.modifiers)
    Keys.onBacktabPressed: keysTestObject.keyPress(event.key, "Backtab", event.modifiers)
    Keys.forwardTo: [ item2 ]
    Keys.enabled: enableKeyHanding

    Item {
        id: item2
        Keys.onPressed: keysTestObject.forwardedKey(event.key)
        Keys.onReleased: keysTestObject.forwardedKey(event.key)
    }
}