author | alwin <alwin> | 2005-02-28 09:40:30 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-02-28 09:40:30 (UTC) |
commit | 2b64a84d39eeed5681d0ee5068c7d11a01527750 (patch) (unidiff) | |
tree | c8693340dbc5ef5e2f9afa90b690829ddff2c4bd /noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h | |
parent | 61fa699140c5efbb6ba0bf2a62f7e8fbf62976be (diff) | |
download | opie-2b64a84d39eeed5681d0ee5068c7d11a01527750.zip opie-2b64a84d39eeed5681d0ee5068c7d11a01527750.tar.gz opie-2b64a84d39eeed5681d0ee5068c7d11a01527750.tar.bz2 |
other keymapping tool - not working this moment, I have to check it out
- the reason is that the config file is somewhat easier to understand than
from zkbapplet and has a nice config tool.
Please don't put it into any repositories this moment.
Diffstat (limited to 'noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h new file mode 100644 index 0000000..56d6414 --- a/dev/null +++ b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyRepeater.h | |||
@@ -0,0 +1,86 @@ | |||
1 | #ifndef _KEY_REPEATER_H_ | ||
2 | #define _KEY_REPEATER_H_ | ||
3 | |||
4 | #include <qobject.h> | ||
5 | #include <qtimer.h> | ||
6 | #include <qvaluelist.h> | ||
7 | #include <qwindowsystem_qws.h> | ||
8 | |||
9 | #include <syslog.h> | ||
10 | |||
11 | class KeyRepeater : public QObject | ||
12 | { | ||
13 | Q_OBJECT | ||
14 | public: | ||
15 | KeyRepeater(); | ||
16 | virtual ~KeyRepeater(); | ||
17 | |||
18 | typedef enum { | ||
19 | DISABLE=0, | ||
20 | ENABLE=1, | ||
21 | KILL=2, | ||
22 | } RepeaterMode; | ||
23 | |||
24 | void start(int unicode, int keycode, int modifieres); | ||
25 | void stop(int keycode = 0); | ||
26 | void reset(); | ||
27 | |||
28 | void setRepeatable(int keycode, bool enable); | ||
29 | bool isRepeatable(int keycode); | ||
30 | |||
31 | void setMode(int mode){ | ||
32 | switch(mode){ | ||
33 | case DISABLE: | ||
34 | m_mode = DISABLE; | ||
35 | break; | ||
36 | case ENABLE: | ||
37 | m_mode = ENABLE; | ||
38 | break; | ||
39 | case KILL: | ||
40 | m_mode = KILL; | ||
41 | break; | ||
42 | default: | ||
43 | m_mode = ENABLE; | ||
44 | break; | ||
45 | } | ||
46 | } | ||
47 | RepeaterMode getMode(){ | ||
48 | return(m_mode); | ||
49 | } | ||
50 | |||
51 | void setDelay(int msec) | ||
52 | { | ||
53 | m_repeatdelay = msec; | ||
54 | } | ||
55 | void setPeriod(int msec) | ||
56 | { | ||
57 | m_repeatperiod = msec; | ||
58 | } | ||
59 | |||
60 | void statistics(); | ||
61 | private slots: | ||
62 | void autoRepeat(); | ||
63 | private: | ||
64 | int m_unicode; | ||
65 | int m_keycode; | ||
66 | int m_modifiers; | ||
67 | |||
68 | int m_repeatdelay; | ||
69 | int m_repeatperiod; | ||
70 | |||
71 | QCString m_hookChannel; | ||
72 | |||
73 | RepeaterMode m_mode; | ||
74 | |||
75 | QValueList<int> m_disablekeys; | ||
76 | |||
77 | QTimer* m_pTimer; | ||
78 | |||
79 | void init(); | ||
80 | void clear(); | ||
81 | signals: | ||
82 | void keyEvent(int unicode, int keycode, int modifiers, | ||
83 | bool isPress, bool autoRepeat); | ||
84 | }; | ||
85 | |||
86 | #endif /* _KEY_REPEATER_H_ */ | ||