Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

Hold key down for some time

$
0
0
Does anyone know a way to hold a key down for lets say, 10 seconds.

Code:

Dim StopWatch As New StopWatch
StopWatch.Start
Do
SendKeys.SendWait("{Up}")
Loop Until StopWatch.ElapsedMilliseconds >= 5000
StopWatch.Stop

This works for about 2 seconds, then it stops for some reason. It also lags the flipping crap out of my computer. The CPU completely spikes to 100% and I'm on a quad core.

Viewing all articles
Browse latest Browse all 27072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>