Re: Offtopic: simulating a keystroke

Aaron Ucko (amu@mit.edu)
08 Aug 1997 14:04:05 -0500


fb <fb@chibacity.com> writes:

> Woohoo, this may work... I'm not sure though because I think many games
> access they keyboard and read the 'make' or 'break' scan codes instead of
> chars but I will try this

They're still reading from /dev/tty<n>; they just do
ioctl(<kbdfd>, KDSKBMODE, K_RAW); /* or maybe K_MEDIUMRAW */
first, so you can just feed them bytes corresponding to the scan codes.

-- 
Aaron M. Ucko (amu@mit.edu) | For Geek Code, PGP public key, and other info,
finger amu@monk.mit.edu. | "Kids! Bringing about Armageddon can be dangerous.
Do not attempt it in your home." -- T. Pratchett & N. Gaiman, _Good Omens_