EasyAsABC123 / Keyboard

Background/Foreground Keyboard and Mouse input handler
102 stars 43 forks source link

fixed stuck shift, updated demo #12

Closed img02 closed 2 years ago

img02 commented 2 years ago

I had an issue with the shift key being stuck in a key down state, and this fixes it.

I haven't done a deep dive, only found the repo today, but I changed:

structInput.u.ki.dwFlags = KEYEVENTF_KEYUP;  
if (shift && key.ShiftKey == VKeys.NULL) {..}

to

if (shift) {..}

and everything is working. If ShiftType shift was true, ShiftKey should never be null, right?

Also updated the demo to add an exclamation mark to 'hello world' and demonstrate ShiftKey / ShiftType.

EasyAsABC123 commented 2 years ago

LGTM