How do I simulate/release keyboard keys?
问题 I need a way to simulate keyboard keys if a certain condition is met, I also need to know if it's the simulated key that's currently pressed or the real key. This needs to work outside the main application. This is how I would need it to work: Dim UserDefinedKey As Keys = Keys.H Do If GetAsyncKeyState(UserDefinedKey) Then Thread.Sleep(30) 'release the set key Thread.Sleep(30) 'press/hold the set key once, continue the loop if the real key is still been held. End If Loop While GetAsyncKeyState