🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #9613

input.device stuff

#9613
From: Scott Evernden
Date: Fri, 26 Aug 1988 05:02
35 lines
2095 bytes
I am trying to feed a stream of ASCII characters into the input.device.
I'm trying to simulate keyboard activity.

The input.device expects (optionally qualified) raw key presses and
releases.  So, to do what I want, for each character, I must determine
a raw key code and appropriate qualifiers which will generate it.  In
other words, I need something like a RawKeyConvert() that runs backwards
(accepts ASCII and produces a raw key event).

The brute force way is to scan thru the entire KeyMap, trying to discover
keycodes and qualifiers which generate each ASCII code, while filling up a
lookup table.  This turns out to be somewhat painful, since I don't
completely understand the use of some KCF_DEAD key types and other such
stuff.  It's also messy enough that I feel there must be an easier way.

What I really want, tho, is a more direct way to fake keyboard input.
There are comments in "devices/inputevent.h" which suggest a IECLASS_ANSI
may have once existed.  Something like this would appear to be exactly
what I need for tagging input events- like

	ie.ie_Code = <ascii code>;
	ie.ie_Class = IECLASS_ANSI (or IECLASS_ASCII even);

How about:  temporarily SetFunction()'ing RawKeyConvert() ??   Along with
being kludgy and possibly dumb, this is probably impossible, since I
think SetFunction() can only handle library, and not device, vectors. (?)

How about:  SetDefaultKeyMap()'ing my own simple KeyMap for the duration
of the input injection period, and restoring afterwards ?  This doesn't
strike me as being too system-friendly.

As you can tell, I'm groping for a solution here.
Are there some tricks, hints, or tips that I have overlooked??

-scott
Technical Details
Message-ID: <788@applix.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ll-xn!husc6!m2c!applix!scott

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ll-xn!husc6!m2c!applix!scott
From: scott@applix.UUCP (Scott Evernden)
Newsgroups: comp.sys.amiga.tech
Subject: input.device stuff
Message-ID: <788@applix.UUCP>
Date: 26 Aug 88 05:02:32 GMT
Reply-To: scott@applix.UUCP (Scott Evernden)
Organization: APPLiX Inc., Westboro MA
Lines: 35