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 #pragma once
7 
8 #include <QObject>
9 
10 #include <KWaylandServer/kwaylandserver_export.h>
11 
12 namespace KWaylandServer
13 {
14 class SeatInterface;
15 class SurfaceInterface;
16 class KeyboardInterfacePrivate;
17 
18 enum class KeyboardKeyState : quint32;
19 
20 /**
21  * @brief Resource for the wl_keyboard interface.
22  */
23 class KWAYLANDSERVER_EXPORT KeyboardInterface : public QObject
24 {
25  Q_OBJECT
26 public:
27  ~KeyboardInterface() override;
28 
29  /**
30  * @returns the focused SurfaceInterface on this keyboard resource, if any.
31  */
32  SurfaceInterface *focusedSurface() const;
33 
34  /**
35  * @returns The key repeat in character per second
36  */
37  qint32 keyRepeatRate() const;
38  /**
39  * @returns The delay on key press before starting repeating keys
40  */
41  qint32 keyRepeatDelay() const;
42  void setKeymap(const QByteArray &content);
43 
44  /**
45  * Sets the key repeat information to be forwarded to all bound keyboards.
46  *
47  * To disable key repeat set a @p charactersPerSecond of @c 0.
48  *
49  * Requires wl_seat version 4.
50  *
51  * @param charactersPerSecond The characters per second rate, value of @c 0 disables key repeating
52  * @param delay The delay on key press before starting repeating keys
53  */
54  void setRepeatInfo(qint32 charactersPerSecond, qint32 delay);
55 
56  void sendKey(quint32 key, KeyboardKeyState state);
57  void sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group);
58 
59 private:
60  void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
61  friend class SeatInterface;
62  friend class KeyboardInterfacePrivate;
63  explicit KeyboardInterface(SeatInterface *seat);
64 
66 };
67 
68 }
69 
70 Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface *)
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 Oct 21 2021 23:10:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.