summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/keyboard/keyboard.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp
index a04c45a..0f0b188 100644
--- a/inputmethods/keyboard/keyboard.cpp
+++ b/inputmethods/keyboard/keyboard.cpp
@@ -55,14 +55,14 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
// 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()) );
- }
- }
+// 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()) );
+// }
+ // }
}
@@ -120,16 +120,16 @@ void KeyboardConfig::generateText(const QString &s)
/*
Format: length, code, length, code, ..., 0
-
+
length is measured in half the width of a standard key.
If code < 0x80 we have length/2 consecutive standard keys,
starting with scancode code.
-
+
Special keys are hardcoded, one at a time, with length of key
and code >= 0x80, these are NOT standard PC scancodes, but are looked
up in specialM[]. (The special keys are not keymappable.)
-
+
*/
-static const uchar * const keyboard_opti[5] = {
+static const uchar * const keyboard_opti[5] = {
(const uchar *const) "\001\223\003\240\002\20\002\41\002\26\002\62\002\56\002\45\002\54\003\200\001\223\002\226\002\235\002\234\002\236",
(const uchar *const) "\001\223\003\201\004\207\002\30\002\24\002\43\004\207\003\203\001\223\006\002\002\065",
@@ -153,12 +153,12 @@ static const uchar * const keyboard_standard[5] = {
(const uchar *const)"\004\202\002a\002s\002d\002f\002g\002h\002j\002k\002l\002;\002'\004\203",
- //CAPS + asdf.. + RETURN
+ //CAPS + asdf.. + RETURN
(const uchar *const)"\005\204\002z\002x\002c\002v\002b\002n\002m\002,\002.\002/\005\204\002\223\002\223\002\211",
//SHIFT + zxcv... //+ UP
- (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214"
+ (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214"
//CTRL + ALT + SPACE //+ LEFT + DOWN + RIGHT
-
+
};
@@ -395,5 +395,5 @@ static const char * const escape_xpm[]={
-enum { BSCode = 0x80, TabCode, CapsCode, RetCode,
+enum { BSCode = 0x80, TabCode, CapsCode, RetCode,
ShiftCode, CtrlCode, AltCode, SpaceCode, BackSlash,
UpCode, LeftCode, DownCode, RightCode, Blank, Expand,
@@ -436,5 +436,5 @@ static const SpecialMap specialM[] = {
{ Opti, 0, "#", NULL },
{ ResetDict, 0, "R", NULL },
-
+
// number pad stuff
{ Divide, 0, "/", NULL },
@@ -456,5 +456,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
if ( j <0 || j >= 5 )
return 0;
-
+
const uchar *row = keyboard[j];
@@ -465,5 +465,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
if ( !*row ) return 0;
-
+
int k;
if ( row[1] >= 0x80 ) {
@@ -472,5 +472,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
k = row[1]+i2/2;
}
-
+
return k;
}
@@ -480,5 +480,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
return scancode and width of first key in row \a j if \a j >= 0,
or next key on current row if \a j < 0.
-
+
*/
@@ -488,5 +488,5 @@ int Keyboard::getKey( int &w, int j ) {
static int scancode = 0;
static int half = 0;
-
+
if ( j >= 0 && j < 5 ) {
if (useOptiKeys)
@@ -498,5 +498,5 @@ int Keyboard::getKey( int &w, int j ) {
if ( !row || !*row ) {
- return 0;
+ return 0;
} else if ( row[1] >= 0x80 ) {
scancode = row[1];
@@ -513,5 +513,5 @@ int Keyboard::getKey( int &w, int j ) {
return scancode++;
}
-
+
void Keyboard::paintEvent(QPaintEvent* e)
@@ -541,5 +541,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
int margin = threeD ? 1 : 0;
-
+
// p.fillRect( 0, , kw-1, keyHeight-2, keycolor_pressed );
@@ -555,10 +555,10 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
bool blank = (k == 0223);
const char * const * xpm = NULL;
-
+
if ( k >= 0x80 ) {
s = specialM[k - 0x80].label;
xpm = specialM[k - 0x80].xpm;
-
+
if ( k == ShiftCode ) {
pressed = shift;
@@ -569,9 +569,9 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
} else if ( k == AltCode ) {
pressed = alt;
- }
+ }
} else {
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
/*
- s = QChar( shift^lock ? QWSServer::keyMap()[k].shift_unicode :
+ s = QChar( shift^lock ? QWSServer::keyMap()[k].shift_unicode :
QWSServer::keyMap()[k].unicode);
*/
@@ -622,5 +622,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
p.drawText( x - 1, y, kw, keyHeight-2, AlignCenter, s );
}
-
+
if ( threeD ) {
p.setPen(keycolor_hi);
@@ -631,5 +631,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
p.setPen(keycolor_lo);
p.drawLine( x, y+keyHeight-1, x+kw-1, y+keyHeight-1 );
-
+
} else {
p.fillRect( x, y, kw, keyHeight, cg.background() );
@@ -690,5 +690,5 @@ void Keyboard::mousePressEvent(QMouseEvent *e)
else if ( shift^lock )
u = QWSServer::keyMap()[k].shift_unicode;
- else
+ else
u = QWSServer::keyMap()[k].unicode;
}
@@ -776,5 +776,5 @@ void Keyboard::timerEvent(QTimerEvent* e)
void Keyboard::repeat()
{
-
+
repeatTimer->start( 200 );
emit key( unicode, qkeycode, modifiers, true, true );
@@ -799,5 +799,5 @@ QSize Keyboard::sizeHint() const
if (useOptiKeys)
keyHeight += 1;
-
+
return QSize( 320, keyHeight * 5 + picks->sizeHint().height() + 1 );
}