KWaylandServer

keyboard_interface.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_SERVER_KEYBOARD_INTERFACE_H
7 #define WAYLAND_SERVER_KEYBOARD_INTERFACE_H
8 
9 #include <QObject>
10 
11 #include <KWaylandServer/kwaylandserver_export.h>
12 
13 namespace KWaylandServer
14 {
15 
16 class SeatInterface;
17 class SurfaceInterface;
18 class KeyboardInterfacePrivate;
19 
20 /**
21  * @brief Resource for the wl_keyboard interface.
22  *
23  **/
24 class KWAYLANDSERVER_EXPORT KeyboardInterface : public QObject
25 {
26  Q_OBJECT
27 public:
28  ~KeyboardInterface() override;
29 
30  /**
31  * @returns the focused SurfaceInterface on this keyboard resource, if any.
32  **/
33  SurfaceInterface *focusedSurface() const;
34 
35  /**
36  * @returns The key repeat in character per second
37  **/
38  qint32 keyRepeatRate() const;
39  /**
40  * @returns The delay on key press before starting repeating keys
41  **/
42  qint32 keyRepeatDelay() const;
43  void setKeymap(const QByteArray &content);
44  void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group);
45 
46  /**
47  * Sets the key repeat information to be forwarded to all bound keyboards.
48  *
49  * To disable key repeat set a @p charactersPerSecond of @c 0.
50  *
51  * Requires wl_seat version 4.
52  *
53  * @param charactersPerSecond The characters per second rate, value of @c 0 disables key repeating
54  * @param delay The delay on key press before starting repeating keys
55  *
56  * @since 5.21
57  **/
58  void setRepeatInfo(qint32 charactersPerSecond, qint32 delay);
59 
60  void keyPressed(quint32 key);
61  void keyReleased(quint32 key);
62 
63 private:
64  void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
65  friend class SeatInterface;
66  friend class KeyboardInterfacePrivate;
67  explicit KeyboardInterface(SeatInterface *seat);
68 
70 };
71 
72 }
73 
74 Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface*)
75 
76 #endif
Represents a Seat on the Wayland Display.
Resource for the wl_keyboard interface.
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:09:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.