kingmatte
9 years agoNew Contributor
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 spacebar key. I know about the [Hold] and [ReleaseLast] commands, but I don't know how to reference the right key.
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);