Still working on the keyboard: is this function available in Euphoria??

new topic     » topic index » view thread      » older message » newer message

community.borland.com

Article #16214: Stuff The Keyboard Buffer

 Technical Notes Database

TN1214C.txt   Stuff The Keyboard Buffer
Category   :C++
Platform    :All
Product    :C++  All

Description:
/*

                         SIMULATE KEYSTROKES

Often one needs to simulated keystrokes: to automate data entry, to insert
standard text into an editor ( just like THELP ) etc. etc.   BIOS  (ATs and
above ) provides a function to stuff keys into the BIOS keyboard buffer.
The following is a generic function which takes an ASCIIZ string and inserts
the contents of the latter in the keyboard buffer (NOTE: The keyboard buffer
is 16 bytes long but only 15 characters can be inserted) followed by a
Carriage Return.  It is useful when writing a 'MENU' like program which
would could create a batch file based on the user's requests and *stuff* the
name of the batch file in the keyboard buffer prior to exiting. The last
command in the batch file would run the Menu program again !
*/
#include
/*[]----------------------[ STUFF KEYBOARD USING STRING]------------------[]
   This function stuffs the keyboard buffer with the contents of an ASCIIZ

   string...  A carriage return is appended...
*/
int StuffKbd( char *);
int StuffKbd( char *str )
{
    _AL = 0x00;                    // Assume success !
    while(*str && !_AL)            // While successful and more characters
    {
       _AH = 0x05;                 // Function 05: Kbd Buffer Write
       _CH = 0x00;                 // Scan Code is Zero
       _CL = *str++;               // Load ASCII Code
        geninterrupt(0x16);        // Interrupt 16H
    }
    if (!_AL)                      // If successful in last call
    {
         _CX = 0x1C0D;             // Load Carriage Return
         _AH = 0x05  ;             // Function 05: Kbd Buffer Write
          geninterrupt(0x16);      // Interrupt 16H
    }
    return (_AL);                  // Return 0: Success - 1: Failure
}
int main(void)
{
    StuffKbd("DIR C:\\");          // Request Directory Listing of Root
    return 0;                      // End ...
}


Reference:


7/2/98 10:42:21 AM
 Last Modified: 01-SEP-99

----- Original Message ----- 
From: "Bernie Ryan" <xotron at bluefrognet.net>
To: <EUforum at topica.com>
Sent: Saturday, December 20, 2003 5:14 PM
Subject: Proxy source code Atten: Kat


>
>
> Kat:
>   Here is a small proxy written in "C" which can be easily adapted
>   to Euphoria.
> http://www.programmersheaven.com/zone15/cat241/17838.htm
> Bernie
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu