delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/30/09:41:15

Date: Mon, 30 Mar 1998 17:39:25 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: HackerOC3 <hackeroc3 AT aol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Get_Scan_Code
In-Reply-To: <1998033001563000.UAA06101@ladder01.news.aol.com>
Message-ID: <Pine.SUN.3.91.980330173129.20293G-100000@is>
MIME-Version: 1.0

On 30 Mar 1998, HackerOC3 wrote:

> does anyone have code to get a scan code?  I have this microsoft c code:

This is functionally equivalent to the following:

	#include <bios.h>

	unsigned char Get_Scan_Code (void)
	{
	   if (!bioskey (1))
	     return 0;
	   return bioskey (0);
	}

Two notes about the original code:

	1) It doesn't test the shift status, so you cannot distinguish 
	   between 'a' and 'A'.

	2) In general, I'd advise to make the function return an int, not 
	   an unsigned char (it's a long story).

- Raw text -


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