-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXKeyCaster.hpp
43 lines (33 loc) · 875 Bytes
/
XKeyCaster.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef XKEYCASTER_HPP
#define XKEYCASTER_HPP
#include <QObject>
#include <X11/Xlib.h>
#include "Preferences.hpp"
class XKeyCasterWindow;
class XKeyCaster : public QObject
{
Q_OBJECT
public:
XKeyCaster();
public slots:
void keyCapture();
private:
void movePosition(int dx, int dy);
bool setWindowText(int keycode, int keysym);
QString getKeyName(const QString& name) const;
int getBitPositions(unsigned char x, int r[]) const;
void showPreferencesDialog();
void showContextMenu(const QPoint &point, XKeyCasterWindow* window);
bool isCapsLock() const;
bool isNumLock() const;
void shiftWindowText();
Preferences initPreferences() const;
char keys_current[32], keys_last[32];
int shift_, control_, meta_;
int keycount;
QList<XKeyCasterWindow*> windowList_;
QString preKey_;
Preferences preferences_;
Display* display_;
};
#endif