What does this line of code do?

SendKeys.Send("^(s)")

It’s in an old customization I’m trying to analyse. I get the SendKeys.Send method, but what specifically does the caret-and-letter-s sequence do?

Thanks,
Matthew Morgan

It “presses” the ctrl key.

VBScript - SendKeys Method

2 Likes

On top of Mark’s answer, to combine the ctrl key with something it needs to be wrapped in parentheses like the “s” is. So effectively it is pushing ctrl+s for you and saving whatever it is you’re in.

2 Likes

Also, for those of us who used old serial terminals (green/amber screens) Cntl-S would stop the serial input coming to the screen and Cntl-Q would restart it. (ASCII DC1 and DC3) So if you’re dealing with a serial port, that may be what was happening.

2 Likes