Rick,
I can think of about 200 things that could be causing this (smile). It
is hard to know without seeing exactly what you did and the results you
got. But it is very possible the application isn't passing along the
keystrokes. I can't imagine why hooking any of these would cause your
machine to lock up unless your callback had issues. For example the
OnKeyDown and OnKeyUp events are synchronous. So if you held up the
event by getting in some loop or just doing something that takes a long
time you would cause the OS to time out making the keyboard extremely
sluggish and making things look like they locked up. If you are hooking
a synchronous event you should do as little as possible so you can
return as quickly as possible.
My first suggestion is to see exactly what events you are getting by
using WEEvent. This removes the mystery of your own code.
Doug
On 6/14/2012 7:10 AM, RicksPlace wrote:
Hi Doug:
Quick Background:
I am creating a script in vb.net 2008 express over vb.net 2010 express.
I have filtered so that it will only be started for vb.net 2010
express and that works.
I wanted to monitor for Keyboard Input from a user who is working in
vb.net 2010 express to stop WE from speaking values when the objects
are OffScreen.
Also, I needed to stop any execution of a keypress for those OffScreen
objects.
I wanted to monitor for keyboard input and then suppress speech
and move focus to something else or just trap and not pass through
the keyboard message to stop execution of the OffScreen object.
I have tried OnKeyProcessedDown and OnKeyProcessedUp but got bad
results.
It seems that if I use OnKeyProcessedUp after OnKeyProcessedDown
the OnKeyProcessedUp does not fire within my script.
I tried many methods but got the same results.
I also have worked with Cursor Keys with invalid results.
I then tried the OnKeyUp and OnKeyDown methods of the Keyboard object.
Again, I can get the OnKeyDown to work but it is not followed by
the OnKeyUp event handler being fired.
I forget but some of the tests of OnKeyUp and OnKeyDown have
locked up my computer until I ReBoot - I cant get out of vb.net
2010 express since there is no keyboard input at all.
There have been so many tests that I cant remember exact test results.
I was thinking it might be a timing problem and tried a thread
sleep but that had no effect.
After reading Bruce's analysis of an Async problem he thinks may
exist I looked at Keyboard Input and found that might impact my
project, or not, no real way to tell as far as I know.
My question would be whether Bruce has found a bug and, if so,
could it be impacting my script in Managed Code with all the
Marshalling and cross thread processing?
Also, If you know of a tool or some way I can track keyboard
messages throughout the process I will try and do it since I am
guessing you guys are really tied up with something and this is
mostely a learning project for me.
Thanks:
Rick USA