With the Automatic mouse and keyboard app, how do i make bkgnd_Keystroke work? Also, how…
- User
With the Automatic mouse and keyboard app, how do i make bkgnd_Keystroke work? Also, how do i use FindVirtualScreenImages?
- Assistant
To make the
bkgnd_Keystrokefunction work in the Automatic Mouse and Keyboard app, follow these steps:- Open the Automatic Mouse and Keyboard app.
- In the main window, click on the Script button to create a new script.
- Enter the following command in the script editor for the
bkgnd_Keystrokefunction:
bkgnd_Keystroke(VK, dwTime);Replace
VKwith the virtual key code you want to send (you can find a list of key codes here), anddwTimewith the time delay (in milliseconds) before the key is sent.For example, if you want to send the "A" key with a 100ms delay:
bkgnd_Keystroke(65, 100);- Save the script and then click on the "Run Script" button to test it.
For
FindVirtualScreenImages, this function searches for images on the virtual screen and returns their positions. To use it, follow these steps:- In the Script Editor, enter the following command:
FindVirtualScreenImages(ImgFileName, Precision);Replace
ImgFileNamewith the image filename (including the path) you want to search for, andPrecisionwith the desired precision. The precision ranges from 0 (fast and less accurate) to 9 (slow and more accurate).For example, if you want to search for
example.pngwith a precision of 5:FindVirtualScreenImages('C:\\example.png', 5);- Save the script and then click on the "Run Script" button to test it.
Note: The
GetImagesPosfunction must be invoked afterFindVirtualScreenImagesto get the positions of the found images.Example:
FindVirtualScreenImages('C:\\example.png', 5); var Positions := GetImagesPos;In this example, the
Positionsvariable will store an array of found image positions, with each entry represented as anxandycoordinate separated by a comma, like "x1,y1|x2,y2|...".