summaryrefslogtreecommitdiff
path: root/inputmethods/keyboard
authorharlekin <harlekin>2002-02-16 02:00:41 (UTC)
committer harlekin <harlekin>2002-02-16 02:00:41 (UTC)
commitf8744f9a9a59f7968ddbac66c927ba8da358f223 (patch) (side-by-side diff)
tree8a9670929d1025bd1c610cd3350a6e2cb35ef6b8 /inputmethods/keyboard
parentc91dc39fb820f6f6b9805b96aea282f1deb4d576 (diff)
downloadopie-f8744f9a9a59f7968ddbac66c927ba8da358f223.zip
opie-f8744f9a9a59f7968ddbac66c927ba8da358f223.tar.gz
opie-f8744f9a9a59f7968ddbac66c927ba8da358f223.tar.bz2
Quick and dirty fix for the sticky keyboard problem on ipaq - just turn it off. Turned on on zaurus
Diffstat (limited to 'inputmethods/keyboard') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/keyboard/keyboard.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp
index 9dd24e4..233f08e 100644
--- a/inputmethods/keyboard/keyboard.cpp
+++ b/inputmethods/keyboard/keyboard.cpp
@@ -25,12 +25,14 @@
#include <qwindowsystem_qws.h>
#include <qpainter.h>
#include <qfontmetrics.h>
#include <qtimer.h>
#include <ctype.h>
+#include <sys/utsname.h>
+
#define USE_SMALL_BACKSPACE
Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) :
QFrame(parent, name, f), shift(FALSE), lock(FALSE), ctrl(FALSE),
alt(FALSE), useLargeKeys(TRUE), useOptiKeys(0), pressedKey(-1),
@@ -46,13 +48,25 @@ Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) :
setFont( QFont( "smallsmooth", 9 ) );
picks->initialise();
QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
repeatTimer = new QTimer( this );
- connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
+
+ // temporary quick and dirty fix for the "sticky keyboard bug"
+ // on ipaq.
+ struct utsname name;
+ if (uname(&name) != -1)
+ {
+ QString release=name.release;
+ qWarning("System release: %s\n", name.release);
+ if(release.find("embedix",0,TRUE) !=-1)
+ {
+ connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
+ }
+ }
}
void Keyboard::resizeEvent(QResizeEvent*)
{
int ph = picks->sizeHint().height();
picks->setGeometry( 0, 0, width(), ph );
@@ -758,14 +772,15 @@ void Keyboard::timerEvent(QTimerEvent* e)
clearHighlight();
}
}
void Keyboard::repeat()
{
- repeatTimer->start( 150 );
- emit key( unicode, qkeycode, modifiers, true, true );
+
+ repeatTimer->start( 200 );
+ emit key( unicode, qkeycode, modifiers, true, true );
}
void Keyboard::clearHighlight()
{
if ( pressedKey >= 0 ) {
int tmp = pressedKey;