KWayland

keyboard.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_KEYBOARD_H
7 #define WAYLAND_KEYBOARD_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct wl_keyboard;
14 
15 namespace KWayland
16 {
17 namespace Client
18 {
19 
20 class Surface;
21 
31 class KWAYLANDCLIENT_EXPORT Keyboard : public QObject
32 {
33  Q_OBJECT
34 public:
35  enum class KeyState {
36  Released,
37  Pressed
38  };
39  explicit Keyboard(QObject *parent = nullptr);
40  virtual ~Keyboard();
41 
45  bool isValid() const;
51  void setup(wl_keyboard *keyboard);
60  void release();
75  void destroy();
76 
80  Surface *enteredSurface() const;
84  Surface *enteredSurface();
85 
93  bool isKeyRepeatEnabled() const;
101  qint32 keyRepeatRate() const;
109  qint32 keyRepeatDelay() const;
110 
111  operator wl_keyboard*();
112  operator wl_keyboard*() const;
113 
114 Q_SIGNALS:
120  void entered(quint32 serial);
128  void left(quint32 serial);
138  void keymapChanged(int fd, quint32 size);
146  void keyChanged(quint32 key, KWayland::Client::Keyboard::KeyState state, quint32 time);
151  void modifiersChanged(quint32 depressed, quint32 latched, quint32 locked, quint32 group);
159  void keyRepeatChanged();
160 
161 private:
162  class Private;
164 };
165 
166 }
167 }
168 
169 Q_DECLARE_METATYPE(KWayland::Client::Keyboard::KeyState)
170 
171 #endif
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the wl_keyboard interface.
Definition: keyboard.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Nov 29 2020 22:49:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.