var state = KeyboardState.GetAsyncKeyState(KeyCode.LShift);
if (state != KeyboardKeyState.Default)
{
await Simulate.Events().Release(KeyCode.LShift).Invoke();
}
else
{
await Simulate.Events().Hold(KeyCode.LShift).Invoke();
}
It is supposed to toggle the Shift key. And it does work - once. After the first press state seems to be Toggled no matter what I do. Even restarting the program keeps the key state. Only rebooting resets it back.
I got this code:
It is supposed to toggle the Shift key. And it does work - once. After the first press state seems to be Toggled no matter what I do. Even restarting the program keeps the key state. Only rebooting resets it back.