I understand that I need to be more specific, so I'll explain all the details.
I'm trying to run a variety of old games on FreeDOS, and I want a small TSR
program of mine to emulate specific keystrokes that the running game will
recognize and process.
When I first started to attempt this, I wrote a small program that emulates the
'a' key being pressed and then immediately reads a key using the getch()
function.The key emulation was done using INT 16, like I mentioned before, and
it worked - the program really did read the emulated keystroke.
Then I changed the program so that it installs a small TSR that emulates a
keyboard event every 5 seconds or so, alternating between emulating a key-down
event and a key-up event.When I tested it again with 'a' and in the DOS
console, I saw, as expected, 'a' characters being typed.
So I changed the key from being 'a' to being the right arrow key.Again, it
worked in the console.However, when I started a game (One Must Fall 2097) to
test it there, it did not receive the key events my TSR emulated.
After that, I switched to using the outportb() function - and it worked.The
game moved the characters as if I was pressing the right arrow key for a few
seconds, then releasing it for a while.However, when I started two other games
(Commander Keen 1 and Golden Axe), they did not receive the key events.
>From what I've read, I understand that different games used different input
>methods back then, but there must be some way to emulate keystrokes that would
>affect every application that tries to access the keyboard.After all, they all
>access the same device.I do not need it to work on any hardware - on the
>contrary, I'm very hardware-specific in this project.
Do forgive me for not explaining all this right away; I didn't know what you
would find relevant.
Thanks for your help,- Tomer.
Date: Fri, 18 Nov 2011 11:06:32 -0800
From: [email protected]
To: [email protected]
Subject: Re: [Freedos-devel] Emulating Keystrokes
is this too simplistic,
or can you just redirect something to the con: console for that?
can't you pipe something to the console?
................................................................
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
................................................................
From: Tom Ehlert <[email protected]>
To: Tomer Godinger <[email protected]>
Sent: Friday, November 18, 2011 12:22 PM
Subject: Re: [Freedos-devel] Emulating Keystrokes
> I am trying to emulate a keystroke programmatically under FreeDOS.
> The problem is that I need to make it work for *anything* that uses the
> keyboard.
> So far the attempts I've made (one using INT 16 with AH=5 to
store
> a keystroke in the keyboard buffer, and one using outportb) only
> work for some of the applications I have subsequently run.
> I'm looking to hook into the lowest possible option, that anything
> that wants to use the keyboard has to go through, regardless of their
> implementation.
at least one outportb based method should work everywhere (except on
Bret's sony notebook ;)
as you didn't take the time to specify WHAT does not work under WHIVH
circumstances I wont waste my time either.
> My current idea is trying to replace the keyboard driver with one of my own.
> Do you think that would work?
'regardless of their implementation' ?
> If so, where can I find an open-source keyboard driver I can alter,
> and how do I install it when I'm done?
> Any help on the matter would be highly appreciated.
> Thanks in advance.
>
Mit freundlichen Grüßen/Kind regards
Tom Ehlert
+49-241-79886
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel