BUG: Multiple SendKeys Statement Turns Off NumLock Key
Jul.26, 2010 in
Uncategorized
Symptoms
Executing at least two SendKeys statements in a row results in turning offthe NumLock key. This problem may also affect the CapsLock and ScrollLockkeys.
Resolution
This problem deals with a nesting of capturing the keyboard state. Thefirst SendKeys statement takes a snapshot of the keyboard state and turnsoff all toggles. The second SendKeys statement executes before the firstone played out all keys and restored the keyboard state. So, the keyboardstate is recorded again by the second SendKeys, this time with all togglesstill off. Eventually, the keyboard state is restored to the later state(toggles off).

Leave a Reply