Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
InputDevice.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CINPUTDEVICE_H
4#define CINPUTDEVICE_H
5
6#pragma once
7#include "service_export.h"
8#include <QPoint>
9#include <QSharedPointer>
10
11class SERVICE_EXPORT CInputDevice
12{
13public:
14 static QSharedPointer<CInputDevice> GenerateObject();
15
16 enum MouseButton
17 {
18 LeftButton = 0x01,
19 RightButton = 0x02,
20 MiddleButton = 0x04,
21 LWheelButton = 0x08,
22 RWheelButton = 0x10,
23 UWheelButton = 0x20,
24 DWheelButton = 0x40
25 };
26 Q_DECLARE_FLAGS(MouseButtons, MouseButton)
27 virtual int KeyEvent(quint32 keysym, quint32 keycode, bool down = true) = 0;
28 virtual int MouseEvent(MouseButtons buttons, QPoint pos) = 0;
29 virtual int MouseEvent(MouseButtons buttons, int x, int y) = 0;
30
31protected:
32 MouseButtons m_LastButtons;
33 QPoint m_LastPostion;
34
35 explicit CInputDevice(){}
36};
37
38#endif // CINPUTDEVICE_H