3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-12 02:05:54 +00:00
Brooklyn/plasma/kcms/keyboard/xinput_helper.h
Scare Crowe d2ebfd0519 QortalOS Titan 5.60.12
Screw the description like that inbred T3Q
2022-03-05 21:17:59 +05:00

48 lines
929 B
C++

/*
SPDX-FileCopyrightText: 2010 Andriy Rysin <rysin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef XINPUT_HELPER_H_
#define XINPUT_HELPER_H_
#include "x11_helper.h"
#include <X11/Xlib.h>
#include <fixx11h.h>
class QTimer;
class UdevDeviceNotifier;
class XInputEventNotifier : public XEventNotifier
{
Q_OBJECT
public:
explicit XInputEventNotifier(QWidget *parent = nullptr);
void start() override;
void stop() override;
int registerForNewDeviceEvent(Display *dpy);
Q_SIGNALS:
void newKeyboardDevice();
void newPointerDevice();
protected:
bool processOtherEvents(xcb_generic_event_t *event) override;
private:
int getNewDeviceEventType(xcb_generic_event_t *event);
int xinputEventType;
Display *display;
UdevDeviceNotifier *udevNotifier;
QTimer *keyboardNotificationTimer;
QTimer *mouseNotificationTimer;
};
#endif /* XINPUT_HELPER_H_ */