Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

putting keys in keyboard buffer

Status
Not open for further replies.

shanley06

Programmer
Nov 26, 2002
101
0
0
US
i was wondering if there was a way i could make the computer think that the user typed in certain keys like esc. or crtl or something without the user actually typing keys. thanks in advance for any help
 
nevermind i figured it out...i have a better question though, at what address would i PEEK at to get the value of the buttons pressed that are in teh keyboard buffer
 
i wuz hopin someone could still answer shanley'sh ques. about writin to da keyboard buffer?
 
Me to. I hate the press any key prompt at the end of a program. I would like to poke a key value into the program, so they would not get that prompt.
 
ok, to put a key into the keyboard buffer without the user actually pressing the button you will need to know the scan code of the key and the character of the key. this uses interrupt 15 sub function DE10h. ok they way i did it was


TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
DIM SHARED Regs AS RegType

SUB writekeytobuffer (scancode,char)
Regs.AX=&HDE10
Regs.BH=scancode
Regs.BL=char
CALL INTERRUPT(&H15,Regs,Regs)
END SUB
[\b][\color blue]

if you want to know the exact specifications of the subfunction of the interrupt i used they are

NT 15 - DESQview v2.00+ - "PUSHKEY" - PUT KEY INTO KEYBOARD INPUT STREAM
AX = DE10h
BH = scan code
BL = character
Return: nothing
Notes: a later read will get the keystroke as if it had been typed by the user
multiple pushes are read last-in first-out
if a script exists for the pushed key in the current application, the
script will be executed
early copies of DV 2.00 destroy AX, BX, ES, and DI
SeeAlso: INT 16/AH=05h

I got that from ralph browns interrupt list
 
ok, to put a key into the keyboard buffer without the user actually pressing the button you will need to know the scan code of the key and the character of the key. this uses interrupt 15 sub function DE10h. ok they way i did it was


TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
DIM SHARED Regs AS RegType

SUB writekeytobuffer (scancode,char)
Regs.AX=&HDE10
Regs.BH=scancode
Regs.BL=char
CALL INTERRUPT(&H15,Regs,Regs)
END SUB
[/color blue]

if you want to know the exact specifications of the subfunction of the interrupt i used they are

NT 15 - DESQview v2.00+ - "PUSHKEY" - PUT KEY INTO KEYBOARD INPUT STREAM
AX = DE10h
BH = scan code
BL = character
Return: nothing
Notes: a later read will get the keystroke as if it had been typed by the user
multiple pushes are read last-in first-out
if a script exists for the pushed key in the current application, the
script will be executed
early copies of DV 2.00 destroy AX, BX, ES, and DI
SeeAlso: INT 16/AH=05h

I got that from ralph browns interrupt list
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top