Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· OpenAIAi2 WildChat-4.8M (AI2)

With the Automatic mouse and keyboard app, how do i make bkgnd_Keystroke work? Also, how…

  1. User

    With the Automatic mouse and keyboard app, how do i make bkgnd_Keystroke work? Also, how do i use FindVirtualScreenImages?

  2. Assistant

    To make the bkgnd_Keystroke function work in the Automatic Mouse and Keyboard app, follow these steps:

    1. Open the Automatic Mouse and Keyboard app.
    2. In the main window, click on the Script button to create a new script.
    3. Enter the following command in the script editor for the bkgnd_Keystroke function:
    bkgnd_Keystroke(VK, dwTime);
    

    Replace VK with the virtual key code you want to send (you can find a list of key codes here), and dwTime with 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);
    
    1. 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:

    1. In the Script Editor, enter the following command:
    FindVirtualScreenImages(ImgFileName, Precision);
    

    Replace ImgFileName with the image filename (including the path) you want to search for, and Precision with 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.png with a precision of 5:

    FindVirtualScreenImages('C:\\example.png', 5);
    
    1. Save the script and then click on the "Run Script" button to test it.

    Note: The GetImagesPos function must be invoked after FindVirtualScreenImages to get the positions of the found images.

    Example:

    FindVirtualScreenImages('C:\\example.png', 5);
    var Positions := GetImagesPos;
    

    In this example, the Positions variable will store an array of found image positions, with each entry represented as an x and y coordinate separated by a comma, like "x1,y1|x2,y2|...".