summaryrefslogtreecommitdiff
path: root/noncore/apps/keyz-cfg/zkb.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/keyz-cfg/zkb.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/keyz-cfg/zkb.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp
index 58bde2a..c9e1dc5 100644
--- a/noncore/apps/keyz-cfg/zkb.cpp
+++ b/noncore/apps/keyz-cfg/zkb.cpp
@@ -1,13 +1,17 @@
#include "zkb.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+
#include <stdio.h>
// Implementation of Action class
Action::Action():state(0), keycode(0), unicode(0), flags(0) {
}
Action::Action(State* s, ushort kc, ushort uni, int f):
state(s), keycode(kc), unicode(uni), flags(f) {
}
Action::~Action() {
}
@@ -243,51 +247,49 @@ Keymap::Keymap():enabled(true), currentState(0), autoRepeatAction(0), repeater(t
Keymap::~Keymap() {
QMap<QString, State*>::Iterator it;
for(it = states.begin(); it != states.end(); ++it) {
delete it.data();
}
states.clear();
}
bool Keymap::filter(int unicode, int keycode, int modifiers,
bool isPress, bool autoRepeat) {
- qDebug("filter: >>> unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", unicode, keycode, modifiers, isPress);
+ odebug << "filter: >>> unicode=" << unicode << ", keycode=" << keycode
+ << ", modifiers=" << modifiers << ", ispressed=" << isPress << oendl;
if (!enabled) {
return false;
}
// the second check is workaround to make suspend work if
// the user pressed it right after he did resume. for some
// reason the event sent by qt has autoRepeat true in this
// case
if (autoRepeat && keycode != 4177) {
return true;
}
(void) unicode; (void) modifiers;
Action* action = currentState->get(keycode, isPress, true);
if (action==0 || !action->isDefined()) {
return true;
}
if (action->hasEvent()) {
- qDebug("filter:<<< unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", action->getUnicode(),
- action->getKeycode(), action->getModifiers(),
- action->isPressed());
+ odebug << "filter:<<< unicode=" << action->getUnicode() << ", keycode=" << action->getKeycode()
+ << ", modifiers=" << action->getModifiers() << ", ispressed=" << action->isPressed() << oendl;
QWSServer::sendKeyEvent(action->getUnicode(),
action->getKeycode(), action->getModifiers(),
action->isPressed(), false);
}
if (action->isAutorepeat()) {
autoRepeatAction = action;
repeater.start(repeatDelay, TRUE);
} else {
autoRepeatAction = 0;
}
@@ -395,26 +397,25 @@ State* Keymap::getCurrentState() const {
QString Keymap::getCurrentLabel() {
return currentLabel;
}
bool Keymap::setCurrentState(State* state) {
QMap<QString, State*>::Iterator it;
for(it = states.begin(); it != states.end(); ++it) {
State* s = it.data();
if (s == state) {
currentState = s;
currentStateName = it.key();
- qDebug("state changed: %s\n", (const char*)
- currentStateName.utf8());
+ odebug << "state changed: " << (const char*)currentStateName.utf8() << oendl;
if (!lsmapInSync) {
generateLabelStateMaps();
}
QMap<State*, QString>::Iterator tit;
tit = stateLabelMap.find(state);
if (tit != stateLabelMap.end()) {
currentLabel = tit.data();
} else {
// odebug << "no label for: " + currentStateName + "\n" << oendl;
currentLabel = "";
@@ -454,29 +455,28 @@ bool Keymap::removeState(const QString& name, bool force) {
}
states.remove(it);
delete state;
lsmapInSync = false;
return true;
}
void Keymap::autoRepeat() {
if (autoRepeatAction != 0) {
- qDebug("filter:<<< unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", autoRepeatAction->getUnicode(),
- autoRepeatAction->getKeycode(),
- autoRepeatAction->getModifiers(),
- autoRepeatAction->isPressed());
+ odebug << "filter:<<< unicode=" << autoRepeatAction->getUnicode()
+ << ", keycode=" << autoRepeatAction->getKeycode()
+ << ", modifiers=" << autoRepeatAction->getModifiers()
+ << "ispressed=" << autoRepeatAction->isPressed() << oendl;
QWSServer::sendKeyEvent(autoRepeatAction->getUnicode(),
autoRepeatAction->getKeycode(),
autoRepeatAction->getModifiers(),
autoRepeatAction->isPressed(), true);
}
repeater.start(repeatPeriod, TRUE);
}
bool Keymap::addLabel(const QString& label, const QString& state, int index) {
if (labels.find(label) != labels.end()) {