Diffstat (limited to 'noncore/applets/keyhelper/keyhelperapplet/misc/KeyAction.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/misc/KeyAction.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/misc/KeyAction.h b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyAction.h new file mode 100644 index 0000000..4eb5eb6 --- a/dev/null +++ b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyAction.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #ifndef _KEY_ACTION_H_ | ||
2 | #define _KEY_ACTION_H_ | ||
3 | |||
4 | #include <qobject.h> | ||
5 | #include <qwindowsystem_qws.h> | ||
6 | #include <qtimer.h> | ||
7 | #include <qpe/power.h> | ||
8 | #include "KeyMappings.h" | ||
9 | #include "KeyModifiers.h" | ||
10 | #include "KeyExtensions.h" | ||
11 | #include "KeyRepeater.h" | ||
12 | #include "ConfigEx.h" | ||
13 | |||
14 | class KeyAction : public QObject | ||
15 | { | ||
16 | Q_OBJECT | ||
17 | public: | ||
18 | KeyAction(); | ||
19 | virtual ~KeyAction(); | ||
20 | |||
21 | void setKeyMappings(KeyMappings* map) | ||
22 | { | ||
23 | m_pMappings = map; | ||
24 | } | ||
25 | void setKeyModifiers(KeyModifiers* mod) | ||
26 | { | ||
27 | m_pModifiers = mod; | ||
28 | } | ||
29 | void setKeyExtensions(KeyExtensions* ext) | ||
30 | { | ||
31 | m_pExtensions = ext; | ||
32 | } | ||
33 | void setKeyRepeater(KeyRepeater* rep) | ||
34 | { | ||
35 | m_pRepeater = rep; | ||
36 | connect(m_pRepeater, SIGNAL(keyEvent(int,int,int,bool,bool)), | ||
37 | this, SLOT(sendKeyEvent(int,int,int,bool,bool))); | ||
38 | } | ||
39 | void setAction(int unicode, int keycode, int modifiers, | ||
40 | bool isPress, bool autoRepeat); | ||
41 | bool doAction(); | ||
42 | |||
43 | void enable(){ | ||
44 | init(); | ||
45 | m_enable = true; | ||
46 | }; | ||
47 | void disable(){ | ||
48 | m_enable = false; | ||
49 | }; | ||
50 | void setCapture(bool enable){ | ||
51 | m_capture = enable; | ||
52 | } | ||
53 | |||
54 | void setHook(const QCString& s){ | ||
55 | m_hookChannel = s; | ||
56 | } | ||
57 | private: | ||
58 | int m_unicode; | ||
59 | int m_keycode; | ||
60 | int m_modifiers; | ||
61 | bool m_isPress; | ||
62 | bool m_autoRepeat; | ||
63 | |||
64 | bool m_capture; | ||
65 | bool m_enable; | ||
66 | int m_presscnt; | ||
67 | |||
68 | int m_keep_toggle_code; | ||
69 | bool m_keepToggle; | ||
70 | bool m_check; | ||
71 | QValueList<int> m_excludeKeys; | ||
72 | |||
73 | QCString m_hookChannel; | ||
74 | |||
75 | KeyMappings* m_pMappings; | ||
76 | KeyModifiers* m_pModifiers; | ||
77 | KeyExtensions* m_pExtensions; | ||
78 | KeyRepeater* m_pRepeater; | ||
79 | |||
80 | void init(); | ||
81 | bool checkState(); | ||
82 | private slots: | ||
83 | void sendKeyEvent(int unicode, int keycode, int modifiers, | ||
84 | bool isPress, bool autoRepeat); | ||
85 | }; | ||
86 | |||
87 | #endif /* _KEY_ACTION_H_ */ | ||