Article ID: 179987 - Last Review: June 29, 2004 - Revision: 3.1 BUG: Multiple SendKeys Statement Turns Off NumLock KeyThis article was previously published under Q179987 On This PageSYMPTOMS
Executing at least two SendKeys statements in a row results in turning off
the NumLock key. This problem may also affect the CapsLock and ScrollLock
keys.
CAUSE
This problem deals with a nesting of capturing the keyboard state. The
first SendKeys statement takes a snapshot of the keyboard state and turns
off all toggles. The second SendKeys statement executes before the first
one played out all keys and restored the keyboard state. So, the keyboard
state is recorded again by the second SendKeys, this time with all toggles
still off. Eventually, the keyboard state is restored to the later state
(toggles off).
RESOLUTION
To work around this problem, do one of the following:
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
MORE INFORMATIONSteps to Reproduce Behavior
REFERENCES
"Visual Basic 5.0 Programmer's Guide to the Win32 API," by Dan Appleman
Chapter 6: Hardware and System Functions
For additional information, see the following article in the Microsoft Knowledge Base: 177674
(http://support.microsoft.com/kb/177674/EN-US/
)
HOWTO: Toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK Keys
APPLIES TO
| Article Translations
|

Back to the top
