I am using the sendinput api call and it works great if I send a key to the keyboard, but when I try to send say SHIFT + "n", it will capitalize the N, but the shift stays locked. So the next letter is capitalized too. I have code that presses the key and then unpresses it, like the api suggests.

So I press SHIFT
Press "n"
unpress "n"
unpress SHIFT

All the variations of the above do not work either (ie. unpress SHIFT before unpressing "n"). If anyone knows what I am doing wrong please let me know. I have searched the web over and over.