Page 1 of 1

Keypress/macro commands?

Posted: Sun Jan 04, 2004 4:45 am
by PB
I often need to send a keypress or a mouseclick in my apps, but the API code to
do so is quite long to type. Here's two simple examples:

Press Space:
keybd_event_(#VK_SPACE,0,0,0) : keybd_event_(#VK_SPACE,0,#KEYEVENTF_KEYUP,0)

Left mouse click:
mouse_event_(#MOUSEEVENTF_LEFTDOWN,0,0,0,0) : mouse_event_(#MOUSEEVENTF_LEFTUP,0,0,0,0)

It'd be great to have two new commands to replace these, such as:

KeyPress(#VK_SPACE) ; Accept any standard #VK_* constant.
MouseClick(#VK_LBUTTON) ; Also accept #VK_RBUTTON and #VK_MBUTTON.

Should be fairly easy to implement...? :)