Simulating a key press or mouse button press

Blitz3D Forums/Blitz3D Beginners Area/Simulating a key press or mouse button press

Kendo(Posted 2008) [#1]
Hi all

Is it possible to simulate a key press or mouse button press?

I have a number of procedures which are called by appropriate key presses or mouse button presses

e.g if keydown(37) then PROC_dothisfunction
if mousedown(1) the PROC_doanotherfunction

For various reasons i won't go into (but not least of which is that I've cocked up my programming logic in a program) I need to "trick" Blitz 3D into thinking I have performed the above presses when in fact I have not physically done so.

Thanks in advance


Stevie G(Posted 2008) [#2]
;get user input
Key37 = keydown( 37 )
MD1 = mousedown(1)

if Key37 PROC_dothisfunction
if MD1 PROC_doanotherfunction

To force a keypress just put Key37 = true or MD1 = true after the user input and before the functions are called.

Stevie


Kendo(Posted 2008) [#3]
Hello Stevie

Many thanks for your response which does the trick perfectly.

Regards