[UNIX-VM-FIX] Keyboard and Squeak Charset

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Thu Mar 18 22:19:54 UTC 1999


Hi all Non-English-Native-Unix-Squeakers :-)

Here comes a little fix to make Squeak receive the characters you actually
type in (a feature other VMs had for a long time). Some of us didn't even
know Squeak supports accented characters :-)

Keystrokes are converted from Latin1 to Mac encodings using a table
generated by GNU recode.

Enjoy!

/bert

-- 
 Bert Freudenberg                                            Department of
                                                            Simulation and
 mailto:bert at isg.cs.uni-magdeburg.de                     Computer Graphics
 http://isgwww.cs.uni-magdeburg.de/isg/bert.html        Univ. of Magdeburg

Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mackeys.diff"
Content-ID: <Pine.LNX.3.96.990318231954.29112B at balloon.cs.uni-magdeburg.de>
Content-Description: 

*** /home/bert/Squeak/2.3/ftp/sqXWindow.c	Thu Mar 18 17:32:42 1999
--- sqXWindow.c	Thu Mar 18 17:24:21 1999
***************
*** 950,955 ****
--- 945,975 ----
  
  /*** Event Recording Functions ***/
  
+ /* Conversion table from `latin1' charset to `mac' charset.
+    Generated mechanically by GNU recode 3.4.1.
+ */
+ 
+ unsigned char const latin1_to_mac[256] =
+ {
+   /* 0 - 127 omitted */
+   196, 197, 171, 201, 209, 247, 220, 225,     /* 128 - 135 */
+   224, 226, 228, 227, 172, 176, 170, 248,     /* 136 - 143 */
+   213, 206, 195, 207, 211, 212, 210, 219,     /* 144 - 151 */
+   218, 221, 246, 245, 250, 249, 251, 252,     /* 152 - 159 */
+   160, 193, 162, 163, 223, 180, 182, 164,     /* 160 - 167 */
+   198, 169, 187, 199, 194, 173, 168, 255,     /* 168 - 175 */
+   161, 177, 178, 179, 165, 181, 166, 183,     /* 176 - 183 */
+   184, 185, 188, 200, 186, 189, 202, 192,     /* 184 - 191 */
+   203, 231, 229, 204, 128, 129, 174, 130,     /* 192 - 199 */
+   233, 131, 230, 232, 237, 234, 235, 236,     /* 200 - 207 */
+   208, 132, 241, 238, 239, 205, 133, 215,     /* 208 - 215 */
+   175, 244, 242, 243, 134, 217, 222, 167,     /* 216 - 223 */
+   136, 135, 137, 139, 138, 140, 190, 141,     /* 224 - 231 */
+   143, 142, 144, 145, 147, 146, 148, 149,     /* 232 - 239 */
+   240, 150, 152, 151, 153, 155, 154, 214,     /* 240 - 247 */
+   191, 157, 156, 158, 159, 253, 254, 216,     /* 248 - 255 */
+ };
+ 
  
  static int translateCode(KeySym symbolic)
  {
***************
*** 1000,1008 ****
    if (nConv == 0 && (keystate= translateCode(symbolic)) < 0)
      return;	/* unknown key */
  
! #if 0
!   if (keystate == 127) keystate= 8;	/* DEL --> BS */
! #endif
  
    keystate|= (modifierMap[(theEvent->state) & 0xF] << 8);
  
--- 1020,1027 ----
    if (nConv == 0 && (keystate= translateCode(symbolic)) < 0)
      return;	/* unknown key */
  
!   if (keystate > 127)
!     keystate = latin1_to_mac[keystate - 128];
  
    keystate|= (modifierMap[(theEvent->state) & 0xF] << 8);
  





More information about the Squeak-dev mailing list