Fake Keyboard

 BBS: Inland Empire Archive
Date: 08-07-92 (08:36)             Number: 189
From: ROBERT CHURCH                Refer#: NONE
  To: SUNNY MARUELI                 Recvd: NO  
Subj: Fake Keyboard                  Conf: (1) 80xxx

SM> Does anyone know how programs like 4DOS's KEYSTACK , fakes keyboard SM> activity? I know there is an undocumented way to do that, but how ?? This is a message I clipped from QUIK_BAS. Read it. Area: QuickBASIC Date: 27 May 92 08:03:00 Public From: Craig Palazzo To: Max Campos Subject: Key-Fake Ä Max: 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. Example: 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" SYSTEM 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 -=CMP=- -+- Maximus 2.01wb + Origin: |=[Bloom Co. Hospital>=--- |[GRapids,MI] (616)361-8345 (1:228/26) -Rob --- GoldED 2.40 * Origin: Rob Church's Point, Hillsboro, Oregon. (1:105/319.27)
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