SendKeys and Number Lock Deactivation

P

PaulaB

I'm looking for feedback on how to work around an issue
where Numbers Lock becomes deactivated when using a
SendKeys statement with non-displayed characters such as
ENTER or TAB. I've noticed that when a bracketed {}
SendKey statement is used, it deactivates the Numbers
Lock. Since SendKeys "{numlock}" is also bracketed, it's
ineffectual in reactivating the Numbers Lock. Does anyone
know if this is intentional, or if it's an unfortuate,
unavoidable side-effect?
-PaulaB
 
M

Marshall Barton

PaulaB said:
I'm looking for feedback on how to work around an issue
where Numbers Lock becomes deactivated when using a
SendKeys statement with non-displayed characters such as
ENTER or TAB. I've noticed that when a bracketed {}
SendKey statement is used, it deactivates the Numbers
Lock. Since SendKeys "{numlock}" is also bracketed, it's
ineffectual in reactivating the Numbers Lock. Does anyone
know if this is intentional, or if it's an unfortuate,
unavoidable side-effect?


I never heard of a way to that, although you may be able to
do just about anything with the right sequence of API calls
if you know enough about Windows programming.

The better approach is to find another way to do whatever
you're trying to use SendKeys to accomplish. This is a good
idea anyway, because SendKeys is not a 100% reliable way to
do much of anything (it presumes that nothing will ever
change which window is active). Even manually using the
keyboard is not 100% reliable since something or other might
popup at any time, but at least a human might notice it and
be able to take an appropriate corrective action (something
your code can't do).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top