From 9861ca46526e65ecb00641008b9e8c1105ba1dc9 Mon Sep 17 00:00:00 2001 From: hash Date: Tue, 15 Oct 2002 16:26:14 +0000 Subject: still trying to figure out how to get those events out wihtout crashing the damn thing --- (limited to 'noncore/apps') 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,6 +1,7 @@ #include "function_keyboard.h" #include #include +#include #include FunctionKeyboard::FunctionKeyboard(QWidget *parent) : @@ -99,12 +100,16 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { // 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); + */ } @@ -117,10 +122,15 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { 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 @@ -41,6 +41,10 @@ public: QSize sizeHint() const; +signals: + + void keyPressed(ushort, ushort, bool, bool, bool); + private: // thie key for the map is the row/col @@ -53,6 +57,8 @@ private: int pressedRow, pressedCol; + QObject *parent; + }; #endif -- cgit v0.9.0.2