Forum Discussion

kingmatte's avatar
kingmatte
New Contributor
9 years ago
Solved

How do I simulate holding down spacebar?

I'm trying to record a script that holds down the spacebar and does a region check while the spacebar is held down. Is this possible? I wasn't able to find anything in the Help documents about the sp...
  • HKosova's avatar
    9 years ago

    I believe Keys releases all keys pressed when it finishes. You probably need KeyDown / KeyUp:

     

    myObj.SetFocus();
    Sys.Desktop.KeyDown(Win32API.VK_SPACE);
    // ... do something
    Sys.Desktop.KeyUp(Win32API.VK_SPACE);