summaryrefslogtreecommitdiff
path: root/qt/qte232-for-qpe150-keyboard.patch
blob: 5e212e92079d5ac522ad6b7c9580bb20d9258b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
--- src/kernel/qkeyboard_qws.cpp.orig	Thu May 23 16:17:43 2002
+++ src/kernel/qkeyboard_qws.cpp	Sat Jun  1 23:22:48 2002
@@ -266,7 +266,7 @@
     {   Qt::Key_O,      'o'     , 'O'     , 'O'-64  },
     {   Qt::Key_P,      'p'     , 'P'     , 'P'-64  },
     {   Qt::Key_BraceLeft,  '['     , '{'     , 0xffff  },
-    {   Qt::Key_Escape,     ']'     , '}'     , 0xffff  },
+    {   Qt::Key_BraceRight, ']'     , '}'     , 0xffff  },
     {   Qt::Key_Return,     13      , 13      , 0xffff  },
     {   Qt::Key_Control,    0xffff  , 0xffff  , 0xffff  },
     {   Qt::Key_A,      'a'     , 'A'     , 'A'-64  },  // 30
@@ -391,7 +391,7 @@
     bool numLock;
 #endif
     bool caps;
-    bool extended;
+    int extended;
     int modifiers;
     int prevuni;
     int prevkey;
@@ -521,7 +521,7 @@
     shift = false;
     alt   = false;
     ctrl  = false;
-    extended = false;
+    extended = 0;
     prevuni = 0;
     prevkey = 0;
     caps = FALSE;
@@ -558,10 +558,24 @@
     int keyCode = Qt::Key_unknown;
     bool release = false;
     int keypad = 0;
+#if defined(QT_QWS_IPAQ) 
+    static int ipaq_return_pressed = false; // iPAQ Action Key has ScanCode 0x60: 0x60|0x80 = 0xe0 == extended mode 1 !
+#endif
+    
 #if !defined(QT_QWS_CUSTOM)
-    if (code == 224) {
+    if ((code == 224) 
+#if defined(QT_QWS_IPAQ)
+    && !ipaq_return_pressed
+#endif    
+    )    
+    {
 	// extended
-	extended = true;
+	extended = 1;
+	return;
+    }
+    else if (code == 225) {
+    	// extended 2
+    	extended = 2;
 	return;
     }
 #endif
@@ -571,7 +585,7 @@
 	code &= 0x7f;
     }
 
-    if (extended) {
+    if (extended == 1) {
 	switch (code) {
 	case 72:
 	    keyCode = Qt::Key_Up;
@@ -609,6 +623,32 @@
 	case 53:
 	    keyCode = Qt::Key_Slash;
 	    break;
+	case 0x1d:
+	    keyCode = Qt::Key_Control;
+	    break;
+	case 0x2a:
+	    keyCode = Qt::Key_SysReq;
+	    break;
+	case 0x38:
+	    keyCode = Qt::Key_Alt;
+	    break;
+	case 0x5b:
+	    keyCode = Qt::Key_Super_L;
+	    break;
+	case 0x5c:
+	    keyCode = Qt::Key_Super_R;
+	    break;
+	case 0x5d:
+	    keyCode = Qt::Key_Menu;
+	    break;	    
+	}
+    } else if (extended == 2) {
+	switch (code) {
+	case 0x1d:
+	    return;
+	case 0x45:
+	    keyCode = Qt::Key_Pause;
+	    break;
 	}
     } else {
 #if defined(QT_QWS_CUSTOM)
@@ -647,6 +687,7 @@
 		repeatable = FALSE;
 		break;
 	    case 0x60:
+		ipaq_return_pressed = !release;
 		keyCode = Key_Return;
 		break;
 	    case 0x67:
@@ -684,13 +725,19 @@
 	else
 	    repeater->stop();
 #endif
+
+	/*
+	 Translate shift+Key_Tab to Key_Backtab
+	*/
+	if (( keyCode == Key_Tab ) && shift )
+	    keyCode = Key_Backtab;
     }
 
     /*
       Keypad consists of extended keys 53 and 28,
       and non-extended keys 55 and 71 through 83.
     */
-    if ( extended ? (code == 53 || code == 28) :
+    if ((extended == 1) ? (code == 53 || code == 28) :
 	 (code == 55 || ( code >= 71 && code <= 83 )) )
 	keypad = Qt::Keypad;
 
@@ -751,7 +798,7 @@
 	bool bShift = shift;
 	int unicode = 0;
 	if (code < keyMSize) {
-	    if (!extended) {
+	    if (extended == 0) {
                 bool bCaps = caps ^ shift;
 #if defined(QT_QWS_CUSTOM)
 		if (fn) {
@@ -790,7 +837,7 @@
 		    unicode =  QWSServer::keyMap()[code].shift_unicode ?  QWSServer::keyMap()[code].shift_unicode : 0xffff;
 		else
 		    unicode =  QWSServer::keyMap()[code].unicode ?  QWSServer::keyMap()[code].unicode : 0xffff;
-	    } else {
+	    } else if (extended == 1) {
 		if ( code == 53 )
 		    unicode = '/';
 	    }
@@ -816,7 +863,7 @@
 	    prevkey = prevuni = 0;
 	}
     }
-    extended = false;
+    extended = 0;
 }