Hi again Guys:
I went back to Aaron's original sample to start from a solid base.
I just flipped the AddHandlers and found that makes a diference in which 
handler function in my script gets executed and which is not executed.
I define a keyboard object as follows in the global module:
Public WithEvents myKeyboard As WindowEyes.Keyboard
myKeyBoard = weApplication.KeyBoard
Then if I add the handlers in the following order:
AddHandler myKeyboard.OnKeyUp, AddressOf OnKeyUpHandler
AddHandler myKeyboard.OnKeyDown, AddressOf OnKeyDownHandler
Only The OnKeyUpHandler function in my script gets executed every time I hit a 
key.
But, if in the following order:
AddHandler myKeyboard.OnKeyDown, AddressOf OnKeyDownHandler
AddHandler myKeyboard.OnKeyUp, AddressOf OnKeyUpHandler
only the OnKeyDownHandler function in my script gets executed.
note that both the OnKeyUp and OnKeyDown events fire when viewing WEEvent but 
no MSAA or other Window events seem to be getting through which would affect 
the OnKeyUp and OnKeyDown events in the underlying vb.net 2010 express 
application.
The fact that only the first added handler fires in my script tells me 
something, not sure what exactly.
If there was an error at compile time I should get a message but no messages, 
if an error at runtime there should be an error or the error handling within 
the Try Catch block should get executed but it is not recording an error either.
So the first AddHandler statement is ok, at least for making my script receive 
the event but the second AddHandler just doesnt work.
I'll have to think on this and let me know if you have run into anything like 
this in the past - this is a new one to me.
Rick USA

Reply via email to