-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkeyb_x11.h
58 lines (50 loc) · 1.62 KB
/
keyb_x11.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef KEYB_X11__h
#define KEYB_X11__h
#include <QX11Info>
#include <QKeySequence>
#include <QAbstractEventDispatcher>
#include <QMutex>
#include <map>
#include <X11/Xlib.h>
#ifdef QT5_OVERRIDES
#include <QAbstractNativeEventFilter>
#endif
class shortcut;
typedef std::pair<KeyCode, unsigned int> keyPair_t;
typedef std::map<keyPair_t, shortcut*> shortcutHash_t;
bool setShortCut(const QKeySequence &s, shortcut* id);
bool unsetShortcut(shortcut* id);
#ifdef QT5_OVERRIDES
class hotKeyFilter : public QAbstractNativeEventFilter
{
protected:
bool nativeEventFilter(const QByteArray & eventType, void * message, long * result);
};
#endif
/*
class shortcutPimpl : public QObject
{
Q_OBJECT
public:
~shortcutPimpl();
bool setShortcut(const QKeySequence &s, shortcut* id);
bool unsetShortcut(shortcut* id);
//void activate(int id){emit activated(id);};
static shortcutPimpl *createShortcutObject();
signals:
void activated(int);
private:
shortcutPimpl();
static void installFilter();
static void uninstallFilter();
static QAbstractEventDispatcher::EventFilter prevFilter;
static bool eventFilter(void *message);
static shortcutHash_t shortcutHash;
static int my_x_errhandler(Display* display, XErrorEvent *event);
static bool grabKeyX(Display *display, Window &window, KeyCode code, unsigned int modifiers);
static bool ungrabKeyX(Display *display, Window &window, KeyCode code, unsigned int modifiers);
static bool removeIdFromHash(shortcut* shortcutId, keyPair_t *kp = NULL);
static bool translateSequence(const QKeySequence &s, KeyCode &code, unsigned int &modifiers);
};
*/
#endif