2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2020-03-15 15:19:28 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2014-11-25 12:39:24 +00:00
|
|
|
#ifndef WAYLAND_SERVER_KEYBOARD_INTERFACE_H
|
|
|
|
#define WAYLAND_SERVER_KEYBOARD_INTERFACE_H
|
|
|
|
|
2020-10-02 14:22:59 +00:00
|
|
|
#include <QObject>
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2020-10-02 14:22:59 +00:00
|
|
|
#include <KWaylandServer/kwaylandserver_export.h>
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2020-04-29 14:56:38 +00:00
|
|
|
namespace KWaylandServer
|
2014-11-25 12:39:24 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class SeatInterface;
|
|
|
|
class SurfaceInterface;
|
2020-10-02 14:22:59 +00:00
|
|
|
class KeyboardInterfacePrivate;
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2015-09-09 11:49:58 +00:00
|
|
|
/**
|
|
|
|
* @brief Resource for the wl_keyboard interface.
|
|
|
|
*
|
|
|
|
**/
|
2020-10-02 14:22:59 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT KeyboardInterface : public QObject
|
2014-11-25 12:39:24 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-10-02 14:22:59 +00:00
|
|
|
~KeyboardInterface() override;
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2015-09-09 11:49:58 +00:00
|
|
|
/**
|
|
|
|
* @returns the focused SurfaceInterface on this keyboard resource, if any.
|
|
|
|
**/
|
2014-11-25 12:39:24 +00:00
|
|
|
SurfaceInterface *focusedSurface() const;
|
|
|
|
|
2020-10-02 14:22:59 +00:00
|
|
|
/**
|
|
|
|
* @returns The key repeat in character per second
|
|
|
|
**/
|
|
|
|
qint32 keyRepeatRate() const;
|
|
|
|
/**
|
|
|
|
* @returns The delay on key press before starting repeating keys
|
|
|
|
**/
|
|
|
|
qint32 keyRepeatDelay() const;
|
|
|
|
|
2014-11-25 12:39:24 +00:00
|
|
|
private:
|
2014-11-26 14:00:44 +00:00
|
|
|
void setFocusedSurface(SurfaceInterface *surface, quint32 serial);
|
2020-03-19 13:58:52 +00:00
|
|
|
void setKeymap(const QByteArray &content);
|
2020-10-02 14:22:59 +00:00
|
|
|
void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group);
|
|
|
|
void keyPressed(quint32 key);
|
|
|
|
void keyReleased(quint32 key);
|
2015-09-02 14:00:11 +00:00
|
|
|
void repeatInfo(qint32 charactersPerSecond, qint32 delay);
|
2020-10-02 14:22:59 +00:00
|
|
|
|
2014-11-25 12:39:24 +00:00
|
|
|
friend class SeatInterface;
|
2020-10-02 14:22:59 +00:00
|
|
|
friend class KeyboardInterfacePrivate;
|
|
|
|
explicit KeyboardInterface(SeatInterface *seat);
|
2014-11-25 12:39:24 +00:00
|
|
|
|
2020-10-02 14:22:59 +00:00
|
|
|
QScopedPointer<KeyboardInterfacePrivate> d;
|
2014-11-25 12:39:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-04-29 14:56:38 +00:00
|
|
|
Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface*)
|
2014-11-26 14:00:44 +00:00
|
|
|
|
2014-11-25 12:39:24 +00:00
|
|
|
#endif
|