TsunamiZ Posted May 17, 2006 Report Share Posted May 17, 2006 Is it possible to hold down any key for x seconds? Thanks. Quote Link to comment Share on other sites More sharing options...
jason Posted May 17, 2006 Report Share Posted May 17, 2006 It is not possible to hold the key down for a specified amount of time, but you could have Macro Express press the key repeatedly for a specified amount of time. I was able to do it with the code below. Variable Set Integer %N1% from Current Second If Variable %N1% >= 30 Variable Modify Integer: %N2% = %N1% - 30 End If If Variable %N1% < 30 Variable Modify Integer: %N2% = %N1% + 30 End If Repeat Until %N2% = %N1% Variable Set Integer %N1% from Current Second Text Type: %N1% (%N2%) Delay 5 Milliseconds Repeat End I had to add a 5 millisecond delay to prevent the keyboard buffer from overflowing. Depending on your system, you may or may not need this delay. When holding down a key, Windows actually presses the key repeatedly as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.