summaryrefslogtreecommitdiff
path: root/noncore
authorhash <hash>2002-10-18 20:21:01 (UTC)
committer hash <hash>2002-10-18 20:21:01 (UTC)
commit179f39a0210314ffa5a31e85f6185df16498d4ac (patch) (side-by-side diff)
tree6f7856b0b136d22ad14d8521986ec36e92c56da7 /noncore
parentbb98ac35db9807efbcc1b59dd8abbdb05ad7656b (diff)
downloadopie-179f39a0210314ffa5a31e85f6185df16498d4ac.zip
opie-179f39a0210314ffa5a31e85f6185df16498d4ac.tar.gz
opie-179f39a0210314ffa5a31e85f6185df16498d4ac.tar.bz2
i'll fix that icon later, but for now here are some better default values
for the keyboard.
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp43
-rw-r--r--noncore/apps/opie-console/function_keyboard.h9
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp2
3 files changed, 31 insertions, 23 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
@@ -6,5 +6,5 @@
FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
- QFrame(parent), numRows(1), numCols(11),
+ QFrame(parent), numRows(2), numCols(11),
pressedRow(0), pressedCol(0) {
@@ -27,5 +27,6 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
);
}
- qWarning("loaded %d keys", keys.count());
+ //qWarning("loaded %d keys", keys.count());
+ if (keys.isEmpty()) loadDefaults();
@@ -102,13 +103,4 @@ void FunctionKeyboard::mousePressEvent(QMouseEvent *e) {
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);
- */
}
@@ -124,12 +116,4 @@ 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);
- */
}
@@ -151,2 +135,23 @@ QSize FunctionKeyboard::sizeHint() const {
}
+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));
+
+}
diff --git a/noncore/apps/opie-console/function_keyboard.h b/noncore/apps/opie-console/function_keyboard.h
index b8420ae..8d05e2b 100644
--- a/noncore/apps/opie-console/function_keyboard.h
+++ b/noncore/apps/opie-console/function_keyboard.h
@@ -18,4 +18,5 @@ public:
ushort getU() { return unicode; }
+
private:
@@ -37,7 +38,4 @@ public:
void mouseReleaseEvent(QMouseEvent*);
void resizeEvent(QResizeEvent*);
-
-
-
QSize sizeHint() const;
@@ -48,4 +46,9 @@ signals:
private:
+ void loadDefaults();
+
+
+private:
+
// thie key for the map is the row/col
QMap<QString, FKey> keys;
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 5900785..0c89620 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -162,5 +162,5 @@ void MainWindow::initUI() {
*/
m_openKeys = new QAction (tr("Open Keyboard..."),
- Resource::loadPixmap( "down" ),
+ Resource::loadPixmap( "console/keyboard_icon.png" ),
QString::null, 0, this, 0);