Hi Rick,
That is why I suggested an Asynchronous type of an event. But as I pointed
out, that one event OnObjectReady is in fact an asynchronous event and
discovered at least in one Windows 7 issue it is not coming back, but does in
an XP machine, so I left it in the Uninstall program for XP users will get the
alert.
Do not know what the WE event is doing to block or pass on that event in a
Windows 7 machine but could be some kind of need for being registered to do it,
for an XP machine does not need it.
As Doug pointed out, anything short of an Asynchronous will lock things up,
or be very slow since you are actually waiting for the vent instead of moving
on.
Maybe some kind of connectevent inside the keydown that does not stay there
but at least does the connection and the event Queue will do the rest for you.
Connectevent (Keyboard, "onKeyUp", "On_Key_Up") kind of thing and see if it
workds...
Bruce
Sent: Thursday, June 14, 2012 10:23 AM
Subject: Re: WOM Seems Flawed for Keyboard Input Handling
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