2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * Author: Daniel d'Andrada <daniel.dandrada@canonical.com>
19#ifndef UNITY_WINDOWINPUTFILTER_H
20#define UNITY_WINDOWINPUTFILTER_H
26 Receives all key events that arrive in the QQuickWindow where this item is placed.
28 Rejected key events will be allowed to be processed normally by the QQuickWindow whereas
29 accepted ones will be filtered out. Events are accepted by default, so make sure you reject
30 the keys you're not interested in.
32 If more than one WindowInputFilter exist in the same QML scene (and thus in the same QQuickWindow)
33 they will be called in the order of creation, which can be tricky to assess. So the best practice
34 is to have at most one WindowInputFilter per QML scene.
36class WindowInputFilter : public QQuickItem
39 Q_PROPERTY(ulong lastInputTimestamp READ lastInputTimestamp NOTIFY lastInputTimestampChanged)
41 WindowInputFilter(QQuickItem *parent = 0);
43 bool eventFilter(QObject *watched, QEvent *event) override;
45 ulong lastInputTimestamp() const;
48 void lastInputTimestampChanged();
51 void setupFilterOnWindow(QQuickWindow *window);
54 QPointer<QQuickWindow> m_filteredWindow;
55 ulong m_lastInputTimestamp;
58#endif // UNITY_WINDOWINPUTFILTER_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list