If a macro is set up with modifier keys (Control, Alt, etc), it will work when using it on the current computer.
But when executing the macro through a remote desktop, the lag will cause the modifier keys to not always register in time.
So you need to add delays after holding the modifiers, before adding the key presses.
Example:
-
You have text in clipboard.
-
Desired result: wrap clipboard content as "System.debug('<clipboard>: ' + <clipboard>);"
-
Macro performs several Ctrl hold, V press-release, Ctrl release (clipboard paste), as well as Shift hold, ; (semicolon) press-release, Shift release.
-
Result of macro when executed via RDP (Remote Desktop) window is: the modifier press isn't always recognized. So you get V and ; instead of the intended output.
Solution:
-
Add a 15ms delay just after every modifier press in the macro.
-
A 5ms delay may work, but still has some misses. 15ms or more recommended for it to work consistently.
-
In our testing, we didn't need to add delays after modifier release.