🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #27318

Re: Control-F1, Alt-F1 ??? - (nf)

#27318
From: Richard Sansom
Date: Mon, 22 Jun 1987 15:37
39 lines
1821 bytes
In article <19400005@qtecmuc.UUCP> ger@qtecmuc.UUCP writes:
>does anyone know, if there is a way to distinguish between
>Functionkey F1, ALT-F1 and CTRL-F1 using C (MWC).
>All routines like Bconin or Crawcin don't make a difference at all.

Try this (I hope I haven't made any glaringly obvious errors - this is all
from memory):

--- cut here ---
/*
 * This little program will display the key scan codes and the ASCII
 * character codes of the keys typed in at the keyboard.  Exit by typing "Q".
 */

#include <stdio.h>
#include <osbind.h>

#define CON 2

main() {
    long lc;
    char scan, ascii;

    for (;;) {
	if (Bconstat(CON)) {
	    lc = Bconin(CON);
	    ascii = (char)(lc & 0xffL);
	    scan = (char)((lc >> 16) & 0xffL);
	    printf("scan = 0x%02x, ascii = 0x%02x\n", scan, ascii);
	    if (ascii == 'Q')
		exit(0);
	}
    }
}
-- 
   /////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  /// Richard E. Sansom                   TRW Electronics & Defense Sector \\\
  \\\ {decvax,ucbvax,ihnp4}!trwrb!sansom  Redondo Beach, CA                ///
   \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////
Technical Details
Message-ID: <1985@trwrb.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!princeton!udel!rochester!cornell!uw-beaver!mit-eddie!ll-xn!cit-vax!elroy!jplgodo!wlbr!scgvaxd!trwrb!sansom
References: <19400005@qtecmuc.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!princeton!udel!rochester!cornell!uw-beaver!mit-eddie!ll-xn!cit-vax!elroy!jplgodo!wlbr!scgvaxd!trwrb!sansom
From: sansom@trwrb.UUCP (Richard Sansom)
Newsgroups: comp.sys.atari.st
Subject: Re: Control-F1, Alt-F1 ??? - (nf)
Message-ID: <1985@trwrb.UUCP>
Date: Mon, 22-Jun-87 11:37:36 EDT
Article-I.D.: trwrb.1985
Posted: Mon Jun 22 11:37:36 1987
Date-Received: Wed, 24-Jun-87 04:49:24 EDT
References: <19400005@qtecmuc.UUCP>
Reply-To: sansom@trwrb.UUCP (Richard Sansom)
Organization: TRW EDS, Redondo Beach, CA
Lines: 39