KWin
Loading...
Searching...
No Matches
keyboard_repeat.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2016, 2017 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "input_event_spy.h"
12
13#include <QObject>
14
15class QTimer;
16
17namespace KWin
18{
19class Xkb;
20
21class KeyboardRepeat : public QObject, public InputEventSpy
22{
23 Q_OBJECT
24public:
25 explicit KeyboardRepeat(Xkb *xkb);
26 ~KeyboardRepeat() override;
27
28 void keyEvent(KeyEvent *event) override;
29
30Q_SIGNALS:
31 void keyRepeat(quint32 key, std::chrono::microseconds time);
32
33private:
34 void handleKeyRepeat();
35 QTimer *m_timer;
36 Xkb *m_xkb;
37 std::chrono::microseconds m_time;
38 quint32 m_key = 0;
39};
40
41}
void keyEvent(KeyEvent *event) override
void keyRepeat(quint32 key, std::chrono::microseconds time)
~KeyboardRepeat() override