aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/pointer/tapWithModifiers.qml
blob: 724754502d9ff664196c10f7d06102249eb385e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.12

Item {
    width: 200
    height: 200
    TapHandler {
        acceptedModifiers: Qt.ControlModifier
        onTapped: console.log("control-tapped")
    }
    TapHandler {
        acceptedModifiers: Qt.NoModifier
        onTapped: console.log("tapped with no modifiers")
    }
    TapHandler {
        onTapped:
            switch (point.modifiers) {
            case Qt.ControlModifier | Qt.AltModifier:
                console.log("CTRL+ALT");
                break;
            case Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier:
                console.log("CTRL+META+ALT");
                break;
            default:
                console.log("other modifiers", point.modifiers)
            }
    }
}