Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index ac35d1c..4119ad4 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp @@ -5,7 +5,7 @@ #include <qapplication.h> FunctionKeyboard::FunctionKeyboard(QWidget *parent) : - QFrame(parent), numRows(1), numCols(11), + QFrame(parent), numRows(2), numCols(11), pressedRow(0), pressedCol(0) { setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); @@ -26,7 +26,8 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : FKey (value_list[0], value_list[1].toUShort(), value_list[2].toUShort()) ); } - qWarning("loaded %d keys", keys.count()); + //qWarning("loaded %d keys", keys.count()); + if (keys.isEmpty()) loadDefaults(); @@ -101,15 +102,6 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { // emit that sucker! FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)]; 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((QObject *)parent, &ke); - */ } @@ -123,14 +115,6 @@ void FunctionKeyboard::mouseReleaseEvent(QMouseEvent *) { FKey k = keys["r" + QString::number(row) + "c" + QString::number(col)]; 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((QObject *)parent, &ke); - */ } } @@ -150,3 +134,24 @@ QSize FunctionKeyboard::sizeHint() const { return QSize(width(), keyHeight * numRows + 1); } +void FunctionKeyboard::loadDefaults() { + + /* what keys should be default? */ + keys.insert( "r0c0", FKey ("F1", 4144, 0)); + keys.insert( "r0c1", FKey ("F2", 4145, 0)); + keys.insert( "r0c2", FKey ("F3", 4145, 0)); + keys.insert( "r0c3", FKey ("F4", 4146, 0)); + keys.insert( "r0c4", FKey ("F5", 4147, 0)); + keys.insert( "r0c5", FKey ("F6", 4148, 0)); + keys.insert( "r0c6", FKey ("F7", 4149, 0)); + keys.insert( "r0c7", FKey ("F8", 4150, 0)); + keys.insert( "r0c8", FKey ("F9", 4151, 0)); + keys.insert( "r0c9", FKey ("F10", 4152, 0)); + keys.insert( "r0c10", FKey ("F11", 4153, 0)); + + keys.insert( "r1c7", FKey ("Ho", 4112, 0)); + keys.insert( "r1c8", FKey ("End", 4113, 0)); + keys.insert( "r1c9", FKey ("PU", 4118, 0)); + keys.insert( "r1c10", FKey ("PD", 4119, 0)); + +} |