summaryrefslogtreecommitdiff
path: root/noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h
authoralwin <alwin>2005-02-28 09:40:30 (UTC)
committer alwin <alwin>2005-02-28 09:40:30 (UTC)
commit2b64a84d39eeed5681d0ee5068c7d11a01527750 (patch) (unidiff)
treec8693340dbc5ef5e2f9afa90b690829ddff2c4bd /noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h
parent61fa699140c5efbb6ba0bf2a62f7e8fbf62976be (diff)
downloadopie-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/KeyMappings.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h
new file mode 100644
index 0000000..9705c8c
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperapplet/misc/KeyMappings.h
@@ -0,0 +1,72 @@
1#ifndef _KEY_MAPPINGS_H_
2#define _KEY_MAPPINGS_H_
3
4#include <qwindowsystem_qws.h>
5#include <qmap.h>
6
7#include <qintdict.h>
8
9class MapInfo
10{
11public:
12 MapInfo(){};
13 MapInfo(int code, int mod = 0, int uni = 0,
14 int shift_uni = 0, int ctrl_uni = 0);
15
16 static const QWSServer::KeyMap* findKeyMap(int code);
17
18 int keycode;
19 int modifiers;
20 int unicode;
21 int shift_unicode;
22 int ctrl_unicode;
23 bool isDefined;
24};
25
26class KeyMappings
27{
28public:
29 typedef QWSServer::KeyMap KeyMap;
30 typedef QMap<int, MapInfo> CodeMaps;
31
32 KeyMappings();
33 virtual ~KeyMappings();
34
35 void setOriginal(int unicode, int modifiers);
36 void setModifiers(int modifiers);
37 void setUnicode(int unicode);
38 void setKeycode(int keycode);
39
40 int getUnicode();
41 int getKeycode();
42 int getModifiers();
43 bool isDefined();
44
45 void assign(int keycode, int keymask, int mapcode, int mapmodifiers = 0,
46 int unicode = 0, int shift_unicode = 0, int ctrl_unicode = 0);
47 void assignModifier(const QString& type, const QString& state);
48 void assignUnicode(const QString& kind, const QString& ch);
49 void assignUnicode(int unicode);
50 bool apply(int unicode, int keycode, int modifiers, int keymask, bool isPress);
51 bool apply(int keycode, int keymask, bool isPress);
52 void setCapsLock(bool on=true){
53 m_capslock = on;
54 }
55
56 void reset();
57
58 void statistics();
59private:
60 QMap<int, CodeMaps*> m_keymaps;
61 MapInfo m_keyinfo;
62 int m_modifiers;
63 CodeMaps::Iterator m_it;
64
65 bool m_capslock;
66 bool m_isMapped;
67
68 void init();
69 void clear();
70};
71
72#endif /* _KEY_MAPPINGS_H_ */