Re: Still working on the keyboard: is this function available in E=
- Posted by "paul larmuseau" <plarmuseau at pandora.be> Dec 22, 2003
- 445 views
Hi Kate i am simply trying to find some source code, to study how we could do the keyboardwriting I suggest your 32bit remark is right, but i suppose the 'source' code i found is or obsolete, or since the ASCI table is 8bit it doesn't matter ? This is another nifty C++ code, wonder if this is translateable ? /* Turbo C Technical Support Notes: Stuff the keyboard buffer with characters. Created: 7/1/88 Revision History: */ #include <dos.h> #include <string.h> #define START_BUF 30 main() { int i; int len; static char s[] =3D "dir\r"; int far *kbhead =3D MK_FP(0x40,26); int far *kbtail =3D MK_FP(0x40,28); int far *kbuffer =3D MK_FP(0x40,30); len =3D strlen(s); *kbhead =3D START_BUF; *kbtail =3D START_BUF+(len<<1); for (i=3D0; i<len; i++) kbuffer[i] =3D s[i]; } =1A ----- Original Message -----=20 From: "Hayden McKay" <hmck1 at dodo.com.au> To: <EUforum at topica.com> Sent: Sunday, December 21, 2003 2:41 AM Subject: Re: Still working on the keyboard: is this function available in Euphoria?? > > > Isn't the keyboard buffer 32 bytes long starting at 0040:001E (#41E)? > Or is the 32 Byte word at 0040:001E just the start position of keyb buffer? > How did you get 16 bytes long? > > I would like some help on this one as I have been stuck writing keyb buffer > stuff in the past because of some confution here. > > > ----- Original Message -----=20 > From: "paul larmuseau" <plarmuseau at pandora.be> > To: <EUforum at topica.com> > Sent: Sunday, December 21, 2003 10:02 AM > Subject: Still working on the keyboard: is this function available in > Euphoria?? > > > > 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 las= t > > 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 =3D 0x00; // Assume success ! > > while(*str && !_AL) // While successful and more characters > > { > > _AH =3D 0x05; // Function 05: Kbd Buffer Write > > _CH =3D 0x00; // Scan Code is Zero > > _CL =3D *str++; // Load ASCII Code > > geninterrupt(0x16); // Interrupt 16H > > } > > if (!_AL) // If successful in last call > > { > > _CX =3D 0x1C0D; // Load Carriage Return > > _AH =3D 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 -----=20 > > 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! > > > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > --=20 > > Incoming mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/03 > > > > --- > > > --=20 > > > > TOPICA - Start your own email discussion group. FREE! > >