summaryrefslogtreecommitdiff
path: root/noncore/apps/keyz-cfg/zkb.cpp
Unidiff
Diffstat (limited to 'noncore/apps/keyz-cfg/zkb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/keyz-cfg/zkb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp
index c9e1dc5..a357b88 100644
--- a/noncore/apps/keyz-cfg/zkb.cpp
+++ b/noncore/apps/keyz-cfg/zkb.cpp
@@ -1,16 +1,17 @@
1#include "zkb.h" 1#include "zkb.h"
2 2
3/* OPIE */ 3/* OPIE */
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5#include <opie2/okeyfilter.h>
5 6
6#include <stdio.h> 7#include <stdio.h>
7 8
8// Implementation of Action class 9// Implementation of Action class
9Action::Action():state(0), keycode(0), unicode(0), flags(0) { 10Action::Action():state(0), keycode(0), unicode(0), flags(0) {
10} 11}
11 12
12Action::Action(State* s, ushort kc, ushort uni, int f): 13Action::Action(State* s, ushort kc, ushort uni, int f):
13 state(s), keycode(kc), unicode(uni), flags(f) { 14 state(s), keycode(kc), unicode(uni), flags(f) {
14} 15}
15 16
16Action::~Action() { 17Action::~Action() {
@@ -237,24 +238,26 @@ int State::translateKeycode(int keycode) const {
237 238
238 return -1; 239 return -1;
239} 240}
240 241
241// Implementation of Keymap class 242// Implementation of Keymap class
242Keymap::Keymap():enabled(true), currentState(0), autoRepeatAction(0), repeater(this) { 243Keymap::Keymap():enabled(true), currentState(0), autoRepeatAction(0), repeater(this) {
243 repeatDelay=400; 244 repeatDelay=400;
244 repeatPeriod=80; 245 repeatPeriod=80;
245 connect(&repeater, SIGNAL(timeout()), this, SLOT(autoRepeat())); 246 connect(&repeater, SIGNAL(timeout()), this, SLOT(autoRepeat()));
246} 247}
247 248
248Keymap::~Keymap() { 249Keymap::~Keymap() {
250 odebug << "removing keyboard filter for zkb"<<oendl;
251 Opie::Core::OKeyFilter::inst()->remHandler(this);
249 QMap<QString, State*>::Iterator it; 252 QMap<QString, State*>::Iterator it;
250 for(it = states.begin(); it != states.end(); ++it) { 253 for(it = states.begin(); it != states.end(); ++it) {
251 delete it.data(); 254 delete it.data();
252 } 255 }
253 states.clear(); 256 states.clear();
254} 257}
255 258
256bool Keymap::filter(int unicode, int keycode, int modifiers, 259bool Keymap::filter(int unicode, int keycode, int modifiers,
257 bool isPress, bool autoRepeat) { 260 bool isPress, bool autoRepeat) {
258 261
259 odebug << "filter: >>> unicode=" << unicode << ", keycode=" << keycode 262 odebug << "filter: >>> unicode=" << unicode << ", keycode=" << keycode
260 << ", modifiers=" << modifiers << ", ispressed=" << isPress << oendl; 263 << ", modifiers=" << modifiers << ", ispressed=" << isPress << oendl;