summaryrefslogtreecommitdiff
Unidiff
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) :
55 // temporary quick and dirty fix for the "sticky keyboard bug" 55 // temporary quick and dirty fix for the "sticky keyboard bug"
56 // on ipaq. 56 // on ipaq.
57 struct utsname name; 57// struct utsname name;
58 if (uname(&name) != -1) 58// if (uname(&name) != -1)
59 { 59 // {
60 QString release=name.release; 60 //QString release=name.release;
61 qWarning("System release: %s\n", name.release); 61 //qWarning("System release: %s\n", name.release);
62 if(release.find("embedix",0,TRUE) !=-1) 62 //if(release.find("embedix",0,TRUE) !=-1)
63 { 63 // {
64 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); 64 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
65 } 65 // }
66 } 66 // }
67} 67}
68 68
@@ -120,16 +120,16 @@ void KeyboardConfig::generateText(const QString &s)
120/* 120/*
121 Format: length, code, length, code, ..., 0 121 Format: length, code, length, code, ..., 0
122 122
123 length is measured in half the width of a standard key. 123 length is measured in half the width of a standard key.
124 If code < 0x80 we have length/2 consecutive standard keys, 124 If code < 0x80 we have length/2 consecutive standard keys,
125 starting with scancode code. 125 starting with scancode code.
126 126
127 Special keys are hardcoded, one at a time, with length of key 127 Special keys are hardcoded, one at a time, with length of key
128 and code >= 0x80, these are NOT standard PC scancodes, but are looked 128 and code >= 0x80, these are NOT standard PC scancodes, but are looked
129 up in specialM[]. (The special keys are not keymappable.) 129 up in specialM[]. (The special keys are not keymappable.)
130 130
131 */ 131 */
132 132
133static const uchar * const keyboard_opti[5] = { 133static const uchar * const keyboard_opti[5] = {
134 (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", 134 (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",
135 (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", 135 (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] = {
153 153
154 (const uchar *const)"\004\202\002a\002s\002d\002f\002g\002h\002j\002k\002l\002;\002'\004\203", 154 (const uchar *const)"\004\202\002a\002s\002d\002f\002g\002h\002j\002k\002l\002;\002'\004\203",
155 //CAPS + asdf.. + RETURN 155 //CAPS + asdf.. + RETURN
156 156
157 (const uchar *const)"\005\204\002z\002x\002c\002v\002b\002n\002m\002,\002.\002/\005\204\002\223\002\223\002\211", 157 (const uchar *const)"\005\204\002z\002x\002c\002v\002b\002n\002m\002,\002.\002/\005\204\002\223\002\223\002\211",
158 //SHIFT + zxcv... //+ UP 158 //SHIFT + zxcv... //+ UP
159 159
160 (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214" 160 (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214"
161 //CTRL + ALT + SPACE //+ LEFT + DOWN + RIGHT 161 //CTRL + ALT + SPACE //+ LEFT + DOWN + RIGHT
162 162
163}; 163};
164 164
@@ -395,5 +395,5 @@ static const char * const escape_xpm[]={
395 395
396 396
397enum { BSCode = 0x80, TabCode, CapsCode, RetCode, 397enum { BSCode = 0x80, TabCode, CapsCode, RetCode,
398 ShiftCode, CtrlCode, AltCode, SpaceCode, BackSlash, 398 ShiftCode, CtrlCode, AltCode, SpaceCode, BackSlash,
399 UpCode, LeftCode, DownCode, RightCode, Blank, Expand, 399 UpCode, LeftCode, DownCode, RightCode, Blank, Expand,
@@ -436,5 +436,5 @@ static const SpecialMap specialM[] = {
436 { Opti, 0,"#", NULL }, 436 { Opti, 0,"#", NULL },
437 { ResetDict, 0,"R", NULL }, 437 { ResetDict, 0,"R", NULL },
438 438
439 // number pad stuff 439 // number pad stuff
440 { Divide, 0,"/", NULL }, 440 { Divide, 0,"/", NULL },
@@ -456,5 +456,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
456 if ( j <0 || j >= 5 ) 456 if ( j <0 || j >= 5 )
457 return 0; 457 return 0;
458 458
459 const uchar *row = keyboard[j]; 459 const uchar *row = keyboard[j];
460 460
@@ -465,5 +465,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
465 465
466 if ( !*row ) return 0; 466 if ( !*row ) return 0;
467 467
468 int k; 468 int k;
469 if ( row[1] >= 0x80 ) { 469 if ( row[1] >= 0x80 ) {
@@ -472,5 +472,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
472 k = row[1]+i2/2; 472 k = row[1]+i2/2;
473 } 473 }
474 474
475 return k; 475 return k;
476} 476}
@@ -480,5 +480,5 @@ static int keycode( int i2, int j, const uchar **keyboard )
480 return scancode and width of first key in row \a j if \a j >= 0, 480 return scancode and width of first key in row \a j if \a j >= 0,
481 or next key on current row if \a j < 0. 481 or next key on current row if \a j < 0.
482 482
483*/ 483*/
484 484
@@ -488,5 +488,5 @@ int Keyboard::getKey( int &w, int j ) {
488 static int scancode = 0; 488 static int scancode = 0;
489 static int half = 0; 489 static int half = 0;
490 490
491 if ( j >= 0 && j < 5 ) { 491 if ( j >= 0 && j < 5 ) {
492 if (useOptiKeys) 492 if (useOptiKeys)
@@ -498,5 +498,5 @@ int Keyboard::getKey( int &w, int j ) {
498 498
499 if ( !row || !*row ) { 499 if ( !row || !*row ) {
500 return 0; 500 return 0;
501 } else if ( row[1] >= 0x80 ) { 501 } else if ( row[1] >= 0x80 ) {
502 scancode = row[1]; 502 scancode = row[1];
@@ -513,5 +513,5 @@ int Keyboard::getKey( int &w, int j ) {
513 return scancode++; 513 return scancode++;
514} 514}
515 515
516 516
517void Keyboard::paintEvent(QPaintEvent* e) 517void Keyboard::paintEvent(QPaintEvent* e)
@@ -541,5 +541,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
541 541
542 int margin = threeD ? 1 : 0; 542 int margin = threeD ? 1 : 0;
543 543
544// p.fillRect( 0, , kw-1, keyHeight-2, keycolor_pressed ); 544// p.fillRect( 0, , kw-1, keyHeight-2, keycolor_pressed );
545 545
@@ -555,10 +555,10 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
555 bool blank = (k == 0223); 555 bool blank = (k == 0223);
556 const char * const * xpm = NULL; 556 const char * const * xpm = NULL;
557 557
558 if ( k >= 0x80 ) { 558 if ( k >= 0x80 ) {
559 s = specialM[k - 0x80].label; 559 s = specialM[k - 0x80].label;
560 560
561 xpm = specialM[k - 0x80].xpm; 561 xpm = specialM[k - 0x80].xpm;
562 562
563 if ( k == ShiftCode ) { 563 if ( k == ShiftCode ) {
564 pressed = shift; 564 pressed = shift;
@@ -569,9 +569,9 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
569 } else if ( k == AltCode ) { 569 } else if ( k == AltCode ) {
570 pressed = alt; 570 pressed = alt;
571 } 571 }
572 } else { 572 } else {
573#if defined(Q_WS_QWS) || defined(_WS_QWS_) 573#if defined(Q_WS_QWS) || defined(_WS_QWS_)
574/* 574/*
575 s = QChar( shift^lock ? QWSServer::keyMap()[k].shift_unicode : 575 s = QChar( shift^lock ? QWSServer::keyMap()[k].shift_unicode :
576 QWSServer::keyMap()[k].unicode); 576 QWSServer::keyMap()[k].unicode);
577*/ 577*/
@@ -622,5 +622,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
622 p.drawText( x - 1, y, kw, keyHeight-2, AlignCenter, s ); 622 p.drawText( x - 1, y, kw, keyHeight-2, AlignCenter, s );
623 } 623 }
624 624
625 if ( threeD ) { 625 if ( threeD ) {
626 p.setPen(keycolor_hi); 626 p.setPen(keycolor_hi);
@@ -631,5 +631,5 @@ void Keyboard::drawKeyboard( QPainter &p, int key )
631 p.setPen(keycolor_lo); 631 p.setPen(keycolor_lo);
632 p.drawLine( x, y+keyHeight-1, x+kw-1, y+keyHeight-1 ); 632 p.drawLine( x, y+keyHeight-1, x+kw-1, y+keyHeight-1 );
633 633
634 } else { 634 } else {
635 p.fillRect( x, y, kw, keyHeight, cg.background() ); 635 p.fillRect( x, y, kw, keyHeight, cg.background() );
@@ -690,5 +690,5 @@ void Keyboard::mousePressEvent(QMouseEvent *e)
690 else if ( shift^lock ) 690 else if ( shift^lock )
691 u = QWSServer::keyMap()[k].shift_unicode; 691 u = QWSServer::keyMap()[k].shift_unicode;
692 else 692 else
693 u = QWSServer::keyMap()[k].unicode; 693 u = QWSServer::keyMap()[k].unicode;
694 } 694 }
@@ -776,5 +776,5 @@ void Keyboard::timerEvent(QTimerEvent* e)
776void Keyboard::repeat() 776void Keyboard::repeat()
777{ 777{
778 778
779 repeatTimer->start( 200 ); 779 repeatTimer->start( 200 );
780 emit key( unicode, qkeycode, modifiers, true, true ); 780 emit key( unicode, qkeycode, modifiers, true, true );
@@ -799,5 +799,5 @@ QSize Keyboard::sizeHint() const
799 if (useOptiKeys) 799 if (useOptiKeys)
800 keyHeight += 1; 800 keyHeight += 1;
801 801
802 return QSize( 320, keyHeight * 5 + picks->sizeHint().height() + 1 ); 802 return QSize( 320, keyHeight * 5 + picks->sizeHint().height() + 1 );
803} 803}