Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!sunic!tut!ra!chyde!ts
From: ts@chyde.uwasa.fi (Timo Salmi LASK)
Newsgroups: comp.lang.pascal
Subject: Re: Reading the keyboard
Summary: Use interrupts for extended keyboard
Keywords: keyscan, turbo pascal, interrupts
Message-ID: <794@chyde.uwasa.fi>
Date: 26 Sep 89 18:11:06 GMT
References: <89268.185834TBC101@PSUVM.BITNET>
Reply-To: ts@chyde.uwasa.fi (Timo Salmi LASK)
Organization: U of Vaasa, Finland
Lines: 30

In article <89268.185834TBC101@PSUVM.BITNET> TBC101@PSUVM.BITNET (Thomas B. Collins, Jr.) writes:
>I'm working on a program with Turbo Pascal 5.5, and I've noticed that
>the F11 and F12 keys don't trigger the 'ReadKey' command.  Am I doing
>something wrong, or do I need to do something else in order to read
>these keys?  It should send a null to the first ReadKey, and then a 133

The F11 and F12 keys are part of the extended keyboard, and to
access them you have to use ROM BIOS keyboard services.  The
extended keyboard can be accessed using interrupt 16Hex, service
10Hex.  The main byte is returned in register al, and the auxiliary
byte in the register ah.  If this sounds complicated, see the code
at the end.  For more information see Norton & Wilton, the New Peter
Norton Programmer's Guide to the IBM PC & PS/2, or INTER489.ARC,
available by anynymous ftp from all well stocked sites (and also
ours :-)
...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun


(* Keyscan by Timo Salmi *)
uses Dos;
var regs : registers;
begin
  FillChar (regs, SizeOf(regs), 0);
  regs.ax := $1000;
  Intr ($16, regs);
  writeln (regs.al, ' ', regs.ah);
end.