www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/06/05/06:31:36

Date: Thu, 5 Jun 1997 12:24:58 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Patch for get(x)key
Message-Id: <Pine.HPP.3.95q.970605122037.16452D-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

After a bugreport for RHIDE I found that also the
getkey() and getxkey() functions are buggy. They do
not report the correct value for the character with
the code 224(0xe0).

That means, any program that uses that functions, cannot
use that character (to type it in use the Alt + numpad
code technique). I don't know what programs all affected
by this but it is at least also bash.

BTW: The ASCII 224 is the greek alpha.

Here are now the patches for both functions:

*** src/libc/pc_hw/kb/getkey.c~	Sun Feb 26 20:53:34 1995
--- src/libc/pc_hw/kb/getkey.c	Wed Jun  4 14:47:12 1997
***************
*** 9,15 ****
    r.h.ah = 0x10;
    __dpmi_int(0x16, &r);
  
!   if (r.h.al == 0x00 || r.h.al == 0xe0)
      return 0x0100 | r.h.ah;
    return r.h.al;
  }
--- 9,15 ----
    r.h.ah = 0x10;
    __dpmi_int(0x16, &r);
  
!   if (r.h.al == 0x00 || (r.h.al == 0xe0 && r.h.ah != 0))
      return 0x0100 | r.h.ah;
    return r.h.al;
  }


*** src/libc/pc_hw/kb/getxkey.c~	Sun Feb 26 20:49:04 1995
--- src/libc/pc_hw/kb/getxkey.c	Wed Jun  4 14:47:30 1997
***************
*** 11,17 ****
  
    if (r.h.al == 0x00)
      return 0x0100 | r.h.ah;
!   if (r.h.al == 0xe0)
      return 0x0200 | r.h.ah;
    return r.h.al;
  }
--- 11,17 ----
  
    if (r.h.al == 0x00)
      return 0x0100 | r.h.ah;
!   if (r.h.al == 0xe0 && r.h.ah != 0)
      return 0x0200 | r.h.ah;
    return r.h.al;
  }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019