author | hash <hash> | 2002-10-15 07:58:43 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-15 07:58:43 (UTC) |
commit | 31a73cafb40fffe2bbc12bb6fd0df6dc254d6646 (patch) (unidiff) | |
tree | 09de028ded46d4201207e1749d83525dbffed929 /noncore/apps/opie-console | |
parent | 42ed74a1af7f96c06d2310b9804dacc703e31ad9 (diff) | |
download | opie-31a73cafb40fffe2bbc12bb6fd0df6dc254d6646.zip opie-31a73cafb40fffe2bbc12bb6fd0df6dc254d6646.tar.gz opie-31a73cafb40fffe2bbc12bb6fd0df6dc254d6646.tar.bz2 |
dont know if this works yet, but it should...
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index d8ade69..a5b19c0 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "function_keyboard.h" | 1 | #include "function_keyboard.h" |
2 | #include <qsizepolicy.h> | 2 | #include <qsizepolicy.h> |
3 | #include <qwindowsystem_qws.h> | 3 | #include <qevent.h> |
4 | #include <qapplication.h> | ||
4 | 5 | ||
5 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 6 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
6 | QFrame(parent), numRows(1), numCols(11), | 7 | QFrame(parent), numRows(1), numCols(11), |
@@ -92,7 +93,7 @@ void FunctionKeyboard::paintKey(int row, int col) { | |||
92 | void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { | 93 | void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { |
93 | 94 | ||
94 | pressedRow = e->y() / keyHeight; | 95 | pressedRow = e->y() / keyHeight; |
95 | pressedCol = e->x() / keyWidth; | 96 | pressedCol = (int) (e->x() / keyWidth); |
96 | 97 | ||
97 | paintKey(pressedRow, pressedCol); | 98 | paintKey(pressedRow, pressedCol); |
98 | 99 | ||
@@ -101,6 +102,10 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { | |||
101 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | 102 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); |
102 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); | 103 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 1, 0); |
103 | //qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0); | 104 | //qwsServer->sendKeyEvent(0x41, 0, 0, 1, 0); |
105 | |||
106 | QKeyEvent ke(QEvent::KeyPress, k.getQ(), k.getU(), 0); | ||
107 | QApplication::sendEvent(this, &ke); | ||
108 | |||
104 | } | 109 | } |
105 | 110 | ||
106 | void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { | 111 | void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { |
@@ -114,6 +119,8 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { | |||
114 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; | 119 | FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; |
115 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | 120 | //QWSServer::sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); |
116 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); | 121 | //qwsServer->sendKeyEvent(k.getU(), k.getQ(), 0, 0, 0); |
122 | QKeyEvent ke(QEvent::KeyRelease, k.getQ(), k.getU(), 0); | ||
123 | QApplication::sendEvent(this, &ke); | ||
117 | } | 124 | } |
118 | 125 | ||
119 | } | 126 | } |