www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/18/13:39:14

From: ovek AT arcticnet DOT no (Ove Kaaven)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro: missing KEYs?
Date: Mon, 17 Feb 1997 02:22:29 GMT
Organization: Vplan Programvare AS
Lines: 23
Message-ID: <5ecm3k$esk$1@troll.powertech.no>
References: <5e3iri$lme AT freenet-news DOT carleton DOT ca>
NNTP-Posting-Host: alwayscold.darkness.arcticnet.no
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) wrote:

>I noticed also, it can distinguish left and right shift but not left and
>right control or left and right alt. Is this normal? I know that keyboards
>have different scan codes for left and right alt since I've seen other
>programs that distinguish left and right alt. I don't particularly need to
>distinguish them though.

No they don't really have different scan codes for left and right alt
for standard PC keyboard setups, due to XT (was that 83 keys?)
keyboard compatibility. The way modern 101/102-key keyboards
distinguish them is by a prefix byte (0xE0). So you have:
Left Alt: 0x38
Right Alt: 0xE0 0x38
Left Ctrl: 0x1D
Right Ctrl: 0xE0 0x1D

With simple keyboard handlers that only set a table according to scan
code, and ignoring prefix bytes, you can't distinguish left and right
Alt/Ctrl. (Linux solves this by adding pseudo-scancodes, e.g. converts
0xE0 0x38 to 0x64, 0xE0 0x1D to 0x61, etc, for its raw keyboard mode.)


- Raw text -


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