summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp24
-rw-r--r--noncore/apps/opie-console/function_keyboard.h6
2 files changed, 23 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index a5b19c0..ac35d1c 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -1,7 +1,8 @@
#include "function_keyboard.h"
#include <qsizepolicy.h>
#include <qevent.h>
+#include <qwindowsystem_qws.h>
#include <qapplication.h>
FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
QFrame(parent), numRows(1), numCols(11),
@@ -98,14 +99,18 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) {
paintKey(pressedRow, pressedCol);
// emit that sucker!
FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)];
- //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0);
- //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0);
- //qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0);
+ emit keyPressed(k.getU(), k.getQ(), 0, 1, 0);
+ /*
+ *
+ QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0);
+ qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0);
+ qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0);
QKeyEvent ke(QEvent::KeyPress, k.getQ(), k.getU(), 0);
- QApplication::sendEvent(this, &ke);
+ QApplication::sendEvent((QObject *)parent, &ke);
+ */
}
void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) {
@@ -116,12 +121,17 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) {
int col = pressedCol; pressedCol = -1;
paintKey(row, col);
FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)];
- //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0);
- //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0);
+ emit keyPressed(k.getU(), k.getQ(), 0, 0, 0);
+
+ /*
+ QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0);
+ qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0);
+
QKeyEvent ke(QEvent::KeyRelease, k.getQ(), k.getU(), 0);
- QApplication::sendEvent(this, &ke);
+ QApplication::sendEvent((QObject *)parent, &ke);
+ */
}
}
diff --git a/noncore/apps/opie-console/function_keyboard.h b/noncore/apps/opie-console/function_keyboard.h
index bc3e25c..b8420ae 100644
--- a/noncore/apps/opie-console/function_keyboard.h
+++ b/noncore/apps/opie-console/function_keyboard.h
@@ -40,8 +40,12 @@ public:
QSize sizeHint() const;
+signals:
+
+ void keyPressed(ushort, ushort, bool, bool, bool);
+
private:
// thie key for the map is the row/col
QMap<QString, FKey> keys;
@@ -52,7 +56,9 @@ private:
double keyWidth; // decimal point matters!
int pressedRow, pressedCol;
+ QObject *parent;
+
};
#endif