🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3397

Re: Faking a key press...

#3397
From: MORTEN KNUDSEN
Date: Sun, 27 Sep 1992 19:54
27 lines
1460 bytes
In article <1992Sep24.085956.1@camins.camosun.bc.ca> morley@camins.camosun.bc.ca writes:
>From: morley@camins.camosun.bc.ca
>Subject: Faking a key press...
>Date: 24 Sep 92 16:59:56 GMT
>Hi!
>
>I am writing a TSR program that communicates with an external device via
>the serial port.  This all works fine, but I need to be able to fake a
>key press from within the TSR.  In other words, I want to make it look
>like a certain key was pressed when it actually wasn't.  I also want any
>real key presses to pass through properly.  Does anyone have a snippet
>of C code that will do this?
>
>Thanks a bunch...
>
>MARK
>morley@camins.camosun.bc.ca

There is in fact an easy way of doing this. I cut this out of Ralph's
interrupt listing:

INT 16 - KEYBOARD - STORE KEYSTROKE IN KEYBOARD BUFFER (AT/PS w enh keybd only)
	AH = 05h
	CH = scan code
	CL = ASCII character
Return: AL = 00h if successful
	     01h if keyboard buffer full
Technical Details
Message-ID: <mortenk.18.717623677@dhhalden.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!unidui!Germany.EU.net!mcsun!sunic!aun.uninett.no!nuug!dhhalden.no!pc138.dhhalden.no!mortenk
References: <1992Sep24.085956.1@camins.camosun.bc.ca>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!unidui!Germany.EU.net!mcsun!sunic!aun.uninett.no!nuug!dhhalden.no!pc138.dhhalden.no!mortenk
From: mortenk@dhhalden.no (MORTEN KNUDSEN)
Subject: Re: Faking a key press...
Message-ID: <mortenk.18.717623677@dhhalden.no>
Lines: 27
Sender: news@dhhalden.no (Network News User)
Nntp-Posting-Host: pc138
Organization: Ostfold College
References: <1992Sep24.085956.1@camins.camosun.bc.ca>
Date: Sun, 27 Sep 1992 19:54:37 GMT