BBS: Inland Empire Archive
Date: 05-27-92 (08:03)             Number: 189
From: CRAIG PALAZZO                Refer#: NONE
  To: MAX CAMPOS                    Recvd: NO  
Subj: Key-Fake                       Conf: (2) Quik_Bas

Thanks for the fast reply.  I have since the message found
a way to "Key - Fake" or pack the keyboard buffer on exit
of a program.  The trick was to
know the begining and ending memory locations of the buffer and what mem
segment it resides in.  The buffer is located at Seg 0 and
locations are as follows

1050.....The start pointer. Poke this with the value 30 to clear buffer
1052.....Ending pointer. Poke a value between 32 and 46
1054.....This is the buffer which is 16 characters long.


DEF SEG 0........Puts us in MEMORY segment 0 or DOSville
POKE 1050, 30...."clear buffer"
POKE 1052, 34...."or anynumber between 32 and 46, 32 is one
character 46 being                  8 characters. Note it
takes two poke statements to produce                   one
character.  So the differance between 30 and 34 is 4
           which sets the buffer to except the next 4
characters or 2                   keyboard characters.

POKE 1054, ASC("W")
POKE 1055, ASC("W") Note these two statements produce the ASCII char W
POKE 1056, ASC("P"
POKE 1057, ASC("P") This produces the P
DEF SEG...........Returns us to segment of origin "commonly Dgroup"

This produces WP on the command line and would run the first WP executible
file defined in the path.  The reason for poking the character twice is that
DOS sees the first as a Keyboard scan code and the secound as the ASCII value.
By adding 13 (code for enter key) to the end of our program we can the exit
and have the PC run WP with no other keystrokes.

Thanks again! Peace


--- Maximus 2.01wb
 * Origin: |=[Bloom Co. Hospital>=--- |[GRapids,MI] (616)361-8345 (1:228/26)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET