KWin
Loading...
Searching...
No Matches
keyboard_input.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: 2013, 2016 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "input.h"
12
13#include <QObject>
14#include <QPointF>
15#include <QPointer>
16
17#include <KSharedConfig>
18
19class QWindow;
20struct xkb_context;
21struct xkb_keymap;
22struct xkb_state;
23struct xkb_compose_table;
24struct xkb_compose_state;
25typedef uint32_t xkb_mod_index_t;
26typedef uint32_t xkb_led_index_t;
27typedef uint32_t xkb_keysym_t;
28typedef uint32_t xkb_layout_index_t;
29
30namespace KWin
31{
32
33class Window;
34class InputDevice;
35class InputRedirection;
36class KeyboardLayout;
37class ModifiersChangedSpy;
38class Xkb;
39
40class KWIN_EXPORT KeyboardInputRedirection : public QObject
41{
42 Q_OBJECT
43public:
46
47 void init();
48 void reconfigure();
49
50 void update();
51
55 void processKey(uint32_t key, InputRedirection::KeyboardKeyState state, std::chrono::microseconds time, InputDevice *device = nullptr);
56
57 Xkb *xkb() const;
58 Qt::KeyboardModifiers modifiers() const;
59 Qt::KeyboardModifiers modifiersRelevantForGlobalShortcuts() const;
60
61Q_SIGNALS:
62 void ledsChanged(KWin::LEDs);
63
64private:
65 InputRedirection *m_input;
66 bool m_inited = false;
67 const std::unique_ptr<Xkb> m_xkb;
68 QMetaObject::Connection m_activeWindowSurfaceChangedConnection;
69 ModifiersChangedSpy *m_modifiersChangedSpy = nullptr;
70 KeyboardLayout *m_keyboardLayout = nullptr;
71};
72
73}
This class is responsible for redirecting incoming input to the surface which currently has input or ...
Definition input.h:70
uint32_t xkb_mod_index_t
uint32_t xkb_keysym_t
uint32_t xkb_layout_index_t
uint32_t xkb_led_index_t