author | hash <hash> | 2002-08-19 19:27:19 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-19 19:27:19 (UTC) |
commit | fc58f8b2dea3629fdd486852b74e425a3da29b52 (patch) (side-by-side diff) | |
tree | 6d3393d5f04c2a5447d3d2ca489e4bd74a7e8df4 /inputmethods | |
parent | aaa640a47a707b4d4e6aff37bf78c11bfc903b3c (diff) | |
download | opie-fc58f8b2dea3629fdd486852b74e425a3da29b52.zip opie-fc58f8b2dea3629fdd486852b74e425a3da29b52.tar.gz opie-fc58f8b2dea3629fdd486852b74e425a3da29b52.tar.bz2 |
added a 'key repeat' toggle button
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 31 | ||||
-rw-r--r-- | inputmethods/multikey/configdlg.h | 3 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 39 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 2 |
4 files changed, 57 insertions, 18 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 59a290b..566b2b9 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp @@ -113,6 +113,8 @@ ConfigDlg::ConfigDlg () : QTabWidget () - pick_button = new QCheckBox(tr("Pickboard"), gen_box); + // make a box that will contain the buttons on the bottom + QGrid *other_grid = new QGrid(2, gen_box); + pick_button = new QCheckBox(tr("Pickboard"), other_grid); - config.setGroup ("pickboard"); - bool pick_open = config.readBoolEntry ("open", "0"); // default closed + config.setGroup ("general"); + bool pick_open = config.readBoolEntry ("usePickboard", (bool)0); // default closed if (pick_open) { @@ -125,2 +127,12 @@ ConfigDlg::ConfigDlg () : QTabWidget () + repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); + bool repeat_on = config.readBoolEntry ("useRepeat", (bool)1); + + if (repeat_on) { + + repeat_button->setChecked(true); + } + connect (repeat_button, SIGNAL(clicked()), this, SLOT(repeatTog())); + + /* @@ -171,4 +183,4 @@ void ConfigDlg::pickTog() { Config config ("multikey"); - config.setGroup ("pickboard"); - config.writeEntry ("open", pick_button->isChecked()); // default closed + config.setGroup ("general"); + config.writeEntry ("usePickboard", pick_button->isChecked()); // default closed @@ -177,2 +189,11 @@ void ConfigDlg::pickTog() { +void ConfigDlg::repeatTog() { + + Config config ("multikey"); + config.setGroup ("general"); + config.writeEntry ("useRepeat", repeat_button->isChecked()); // default closed + + emit repeatToggled(repeat_button->isChecked()); +} + /* diff --git a/inputmethods/multikey/configdlg.h b/inputmethods/multikey/configdlg.h index ae7afe2..a000e60 100644 --- a/inputmethods/multikey/configdlg.h +++ b/inputmethods/multikey/configdlg.h @@ -18,2 +18,3 @@ signals: void pickboardToggled(bool on_off); + void repeatToggled(bool on_off); void setMapToDefault(); @@ -24,2 +25,3 @@ private slots: void pickTog(); + void repeatTog(); void setMap(int index); @@ -33,2 +35,3 @@ private: QCheckBox *pick_button; + QCheckBox *repeat_button; QListBox *keymaps; diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 8280297..7334c1c 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp @@ -41,4 +41,2 @@ -#define USE_SMALL_BACKSPACE - /* Keyboard::Keyboard {{{1 */ @@ -46,3 +44,3 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), - alt(0), useLargeKeys(TRUE), usePicks(0), pressedKeyRow(-1), pressedKeyCol(-1), + alt(0), useLargeKeys(TRUE), usePicks(0), useRepeat(0), pressedKeyRow(-1), pressedKeyCol(-1), unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), @@ -59,6 +57,8 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : config = new Config("multikey"); - config->setGroup ("pickboard"); - usePicks = config->readBoolEntry ("open", "0"); // default closed + config->setGroup ("general"); + usePicks = config->readBoolEntry ("usePickboard", "0"); // default closed + useRepeat = config->readBoolEntry ("useRepeat", "1"); delete config; + setFont( QFont( familyStr, 10 ) ); @@ -286,4 +286,2 @@ void Keyboard::mousePressEvent(QMouseEvent *e) configdlg = new ConfigDlg (); - connect(configdlg, SIGNAL(pickboardToggled(bool)), - this, SLOT(togglePickboard(bool))); connect(configdlg, SIGNAL(setMapToDefault()), @@ -292,2 +290,6 @@ void Keyboard::mousePressEvent(QMouseEvent *e) this, SLOT(setMapToFile(QString))); + connect(configdlg, SIGNAL(pickboardToggled(bool)), + this, SLOT(togglePickboard(bool))); + connect(configdlg, SIGNAL(repeatToggled(bool)), + this, SLOT(toggleRepeat(bool))); connect(configdlg, SIGNAL(reloadKeyboard()), @@ -397,3 +399,4 @@ void Keyboard::mousePressEvent(QMouseEvent *e) - pressTid = startTimer(80); + if (useRepeat) repeatTimer->start( 800 ); + //pressTid = startTimer(80); @@ -406,3 +409,3 @@ void Keyboard::mouseReleaseEvent(QMouseEvent*) pressed = FALSE; - if ( pressTid == 0 ) + //if ( pressTid == 0 ) #if defined(Q_WS_QWS) || defined(_WS_QWS_) @@ -427,4 +430,8 @@ void Keyboard::mouseReleaseEvent(QMouseEvent*) /* Keyboard::timerEvent {{{1 */ -/* -void Keyboard::timerEvent(QTimerEvent* e) + +/* dont know what this does, but i think it is here so that if your screen + * sticks (like on an ipaq) then it will stop repeating if you click another + * key... but who knows what anything does in this thing anyway? + + void Keyboard::timerEvent(QTimerEvent* e) { @@ -435,3 +442,3 @@ void Keyboard::timerEvent(QTimerEvent* e) cout << "calling clearHighlight from timerEvent\n"; - clearHighlight(); + //clearHighlight(); } @@ -444,3 +451,3 @@ void Keyboard::repeat() repeatTimer->start( 200 ); - emit key( unicode, 0, modifiers, true, true ); + emit key( unicode, qkeycode, modifiers, true, true ); } @@ -505,2 +512,8 @@ void Keyboard::togglePickboard(bool on_off) +void Keyboard::toggleRepeat(bool on) { + + useRepeat = on; + cout << "setting useRepeat to: " << useRepeat << "\n"; +} + /* Keyboard::setMapTo ... {{{1 */ diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 6e577ab..dc50e55 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h @@ -114,2 +114,3 @@ private slots: void togglePickboard(bool on_off); + void toggleRepeat(bool on_off); void setMapToDefault(); @@ -130,2 +131,3 @@ private: uint usePicks:1; + uint useRepeat:1; |