Why does the control key get "stuck" when debugging in VS2010?
Solution 1:
This bug was reported in Microsoft Connect on September 2010 and reported as "solved in the next major release of Visual Studio".
Nevertheless, the bug was reported again on August 2011, and this time Microsoft was "unable to reproduce the issue".
To my way of thinking, there are two actions that you can take already:
- Report the bug again on Microsoft Connect with exact instructions on how to reproduce.
- As a workaround, remove or replace in the meantime the Crtl-Shift-F5 keyboard mapping.
Solution 2:
Because Visual Studio tracks the control key state using keyboard events, rather than checking it when responding to an event.
Therefore if the KeyUp event for the control key is sent to some other window, and that window swallows the event (marks as Handled), VS2010 will not receive the event notification, then the application will behave as though the ctrl key is still down until you press and release ctrl again (which will cause a keyup event).
This is pure conjecture based on the behavior I've seen (and your observations as well), so I don't know why I am bothering to post this...