[FIX][VM,UNIX] Special keys (was: Nuls in code panes)

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Mon May 14 12:02:09 UTC 2001


On Mon, 14 May 2001, Bert Freudenberg wrote:

> When I press F11 or F12 it should be the same as ALT+'.' or ALT+'j'. So
> you really discovered a bug in the Unix VM. I think it's related to the
> eventification, but I'm not sure yet ...

Okay, I found the bug. The special key translation did not record the ALT
modifier.  Actually it looks like this code was broken since March 1999
when some unknowledgable individual named Bert added foreign character
translation ~:-o

The fix is attached.

-- Bert
-------------- next part --------------
*** Squeak-3.0/src/unix/sqXWindow.c	Tue Feb 13 01:05:07 2001
--- sqXWindow.c	Mon May 14 13:29:09 2001
***************
*** 879,891 ****
    KeySym symbolic;
    nConv= XLookupString(xevt, buf, sizeof(buf), &symbolic, 0);
    charCode= buf[0];
-   if (charCode == 127)
-     charCode= 8;
    if (nConv == 0 && (charCode= translateCode(symbolic)) < 0)
      return;	/* unknown key */
!   if (charCode >= 128)
!     charCode= X_to_Squeak[charCode];
!   modifiers= modifierMap[(xevt->state) & 0xF];
    keystate= charCode | (modifiers << 8);
    if (keystate == interruptKeycode)
      {
--- 907,919 ----
    KeySym symbolic;
    nConv= XLookupString(xevt, buf, sizeof(buf), &symbolic, 0);
    charCode= buf[0];
    if (nConv == 0 && (charCode= translateCode(symbolic)) < 0)
      return;	/* unknown key */
!   if (charCode >= 128) {
!     modifiers= charCode >> 8;
!     charCode= X_to_Squeak[charCode & 0xFF];
!   }
!   modifiers|= modifierMap[(xevt->state) & 0xF];
    keystate= charCode | (modifiers << 8);
    if (keystate == interruptKeycode)
      {
***************
*** 1616,1631 ****
  
    charCode= buf[0];
  
-   if (charCode == 127)
-     charCode= 8;
- 
    if (nConv == 0 && (charCode= translateCode(symbolic)) < 0)
      return;	/* unknown key */
  
!   if (charCode >= 128)
!     charCode= X_to_Squeak[charCode];
  
!   modifiers= modifierMap[(theEvent->state) & 0xF];
    keystate= charCode | (modifiers << 8);
  
    if (keystate == interruptKeycode)
--- 1693,1707 ----
  
    charCode= buf[0];
  
    if (nConv == 0 && (charCode= translateCode(symbolic)) < 0)
      return;	/* unknown key */
  
!   if (charCode >= 128) {
!     modifiers= charCode >> 8;
!     charCode= X_to_Squeak[charCode & 0xFF];
!   }
  
!   modifiers|= modifierMap[(theEvent->state) & 0xF];
    keystate= charCode | (modifiers << 8);
  
    if (keystate == interruptKeycode)


More information about the Squeak-dev mailing list