File indexing completed on 2024-04-14 15:31:34
0001 /* 0002 * SPDX-FileCopyrightText: 2022 Bart Ribbers <bribbers@disroot.org> 0003 * SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #ifndef UINPUTSYSTEM_H 0009 #define UINPUTSYSTEM_H 0010 0011 #include "abstractsystem.h" 0012 0013 class UInputSystem : public AbstractSystem 0014 { 0015 Q_OBJECT 0016 public: 0017 UInputSystem(); 0018 0019 bool init() override; 0020 void emitKey(int key, bool pressed) override; 0021 void setSupportedKeys(const QSet<int> &keys) override; 0022 private: 0023 void emitEvent(int type, int code, int val); 0024 0025 int m_fd = -1; 0026 QSet<int> m_supportedKeys; 0027 }; 0028 0029 #endif // UINPUTSYSTEM_H