-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.h | 6 |
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 @@ | |||
1 | #include "function_keyboard.h" | 1 | #include "function_keyboard.h" |
2 | #include <qsizepolicy.h> | 2 | #include <qsizepolicy.h> |
3 | #include <qevent.h> | 3 | #include <qevent.h> |
4 | #include <qwindowsystem_qws.h> | ||
4 | #include <qapplication.h> | 5 | #include <qapplication.h> |
5 | 6 | ||
6 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 7 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
7 | QFrame(parent), numRows(1), numCols(11), | 8 | QFrame(parent), numRows(1), numCols(11), |
@@ -98,14 +99,18 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { | |||
98 | paintKey(pressedRow, pressedCol); | 99 | paintKey(pressedRow, pressedCol); |
99 | 100 | ||
100 | // emit that sucker! | 101 | // emit that sucker! |
101 | FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)]; | 102 | FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)]; |
102 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | 103 | emit keyPressed(k.getU(), k.getQ(), 0, 1, 0); |
103 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | 104 | /* |
104 | //qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0); | 105 | * |
106 | QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | ||
107 | qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | ||
108 | qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0); | ||
105 | 109 | ||
106 | QKeyEvent ke(QEvent::KeyPress, k.getQ(), k.getU(), 0); | 110 | QKeyEvent ke(QEvent::KeyPress, k.getQ(), k.getU(), 0); |
107 | QApplication::sendEvent(this, &ke); | 111 | QApplication::sendEvent((QObject *)parent, &ke); |
112 | */ | ||
108 | 113 | ||
109 | } | 114 | } |
110 | 115 | ||
111 | void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { | 116 | void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { |
@@ -116,12 +121,17 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { | |||
116 | int col = pressedCol; pressedCol = -1; | 121 | int col = pressedCol; pressedCol = -1; |
117 | paintKey(row, col); | 122 | paintKey(row, col); |
118 | 123 | ||
119 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; | 124 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; |
120 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | 125 | emit keyPressed(k.getU(), k.getQ(), 0, 0, 0); |
121 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | 126 | |
127 | /* | ||
128 | QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | ||
129 | qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | ||
130 | |||
122 | QKeyEvent ke(QEvent::KeyRelease, k.getQ(), k.getU(), 0); | 131 | QKeyEvent ke(QEvent::KeyRelease, k.getQ(), k.getU(), 0); |
123 | QApplication::sendEvent(this, &ke); | 132 | QApplication::sendEvent((QObject *)parent, &ke); |
133 | */ | ||
124 | } | 134 | } |
125 | 135 | ||
126 | } | 136 | } |
127 | 137 | ||
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: | |||
40 | 40 | ||
41 | 41 | ||
42 | QSize sizeHint() const; | 42 | QSize sizeHint() const; |
43 | 43 | ||
44 | signals: | ||
45 | |||
46 | void keyPressed(ushort, ushort, bool, bool, bool); | ||
47 | |||
44 | private: | 48 | private: |
45 | 49 | ||
46 | // thie key for the map is the row/col | 50 | // thie key for the map is the row/col |
47 | QMap<QString, FKey> keys; | 51 | QMap<QString, FKey> keys; |
@@ -52,7 +56,9 @@ private: | |||
52 | double keyWidth; // decimal point matters! | 56 | double keyWidth; // decimal point matters! |
53 | 57 | ||
54 | int pressedRow, pressedCol; | 58 | int pressedRow, pressedCol; |
55 | 59 | ||
60 | QObject *parent; | ||
61 | |||
56 | }; | 62 | }; |
57 | 63 | ||
58 | #endif | 64 | #endif |