Hi Guys:
Chip, I will think on that idea to see if it might tell me something about the 
current problem.
Note that I have used  a registered hot key which worked fine but I am not sure 
that that hot key has the same type of message processing as a standard 
keyboard OnKeyDown or OnKeyUp event.
BT, When I talk of the return value that is the value, as I mentioned, returned 
from my script's OnKeyDown and OnKeyUp handler function.
Here is what I think is suppose to happen.
In my script i create a Keyboard object and then define a handler to monitor 
OnKeyDown and OnKeyUp events which will occur when a user hits a key while 
working in vb.net 2010.
When the user presses a key the code in WindowEyes catches the message and 
forwards it to my script.
Since my script is running in Managed code any variables are Marshaled to .net 
types and presented to my script for processing that keystroke.
My script then does something or nothing with the message from within the event 
handler function's code and sets a return code.
The Return code could be any of the enumerations Windoweyes provides like 
kdPass or kdProcess or kdDiscard etc...
Upon exiting the handler function in my script the message is marshaled to 
convert variables to  data types as defined in the COM interface or Class - I 
get them from the OnKeyUp or OnKeyDown event of the Keyboard object as 
described in the COM  Object Browser.
WindowEyes then again gets the message from my script with the action return of 
kdPass or kdProcess and then performs any Speech operations and, or forwards 
the message to the underlying program or not depending on the code returned to 
WindowEyes from my script.
The codes of kdPass and kdProcess are defined as Int32 data types and therefore 
are called Integer in vb.net.
The Object Browser wants me to return a variable of the type defined in the COM 
Object Browser which is not Int32 but a WindowEyes defined variable type.
Therefore I have tried returnning a variable type as specified in the COM 
Object Browser and defined by GW as the correct data type to return and, in my 
latest test, returned the value as a Integer, neither worked.
The question is what does WindowEyes do with the returned code and message.
If it is using it as a numeric variable, what type?
If using it as a string what type?
The problem I am trying to see if exists is whether WindowEyes is expecting and 
using a data type which is not getting marshaled to the correct data type 
needed by WindowEyes to forward the message returned to it from my script.
I have no way of knowing if this is actually the flow but it seems fairly 
logical that these actions are performed in some way.


  ----- Original Message ----- 
  From: BT 
  To: [email protected] 
  Sent: Tuesday, June 19, 2012 7:59 PM
  Subject: Re: OnKeyDown And OnKeyUp Returned DataType Question



  Hi Rick,

      I was wondering what you mean by returning Int32, for the keyboard 
callback has the key code and the modifier key values returned. Both should be 
integers because they never exceed a value of 256, or at least well below 
32575...

      Now, if the MSAA event is not returning anything inside the WE Event app, 
then what you are looking for is not on the WE Event list, thus not even seen 
by WE. 
      As I had said before, there is a asyncronous event that the keyboard 
sends to WMI because the keyboard itself is syncronous and has not time to stay 
there and wait; for the timer tick count is used to clock all keyboards 
matrices.

      So, if you have set all WE Events to selected and nothing is coming back 
then were dealing still with that same WMI event.

      I sent you the example to test MSAA events and all you have to do is 
modify it to monitor all 4 keyboard events by having a subroutine for each MSAA 
keyboard event and Queue in a voice message for all 4 events.

      So in each event you get some kind of verbal message.

      Let me know if you have tried that; remember, you can activate it by 
holding down Control-Shift-4 keys. Once activated the next keystroke would be 
what you have wanted in terms of some kind of monitoring.

          Bruce

    Sent: Tuesday, June 19, 2012 11:32 AM
    Subject: Re: OnKeyDown And OnKeyUp Returned DataType Question


    Hi Again:
    I used an Object.TypeCode statement to get the 
WindowEyes.KeyDisposition.kdProcess data type and it was int32 which is Integer 
in vb.net.
    So, I changed the function data type returned from 
WindowEyes.KeyDisposition type to Integer but this appears to have no effect on 
the problem.
    So this test seems a dead end.
    I am waiting to hear if WE uses  the value returned from a script's 
OnKeyDown function handler directly as int32 or what it may be converted to 
internally by the WindowEyes code.
    But, at least now I have a clue that my script is returning a int32 value 
of 2 from it's OnKeyDown and OnKeyUp Event Handler Functions for the kdProcess 
Enum.
      If WindowEyes is expecting an int32 value then the problem is likely 
outside my script and outside WindowEyes processing of the returned code but 
still could be in some WE message processing code or other MS Marshalling code 
or just COM gremlins sucking the life out of me.
      Rick USA
      ----- Original Message ----- 
      From: RicksPlace 
      To: [email protected] 
      Sent: Tuesday, June 19, 2012 8:25 AM
      Subject: OnKeyDown And OnKeyUp Returned DataType Question


      Hi Guys:

      In my ongoing OnKeyDown and OnKeyUp saga I am trying to analyze what 
might be going on.

      What is the actual Data Type as used in the WE COM  DLL or Engine or 
whatever of the 

      WindowEyes.KeyDisposition enum 

      variable?

      Are the actual values expected to be returned to WindowEyes used as 
integers (short, long, byte or whatever) or some type of terminated or 
not-terminated string and, if so, what type?

      In my code I have:

      Dim AppropriateDisposition As WindowEyes.KeyDisposition

      AppropriateDisposition = WindowEyes.KeyDisposition.kdProcess

      Return AppropriateDisposition

      This code will apparently allow KeyUp and KeyDown events to be logged 
properly to the WEEvent Viewer but the MSAA and other Events which are suppose 
to be triggered by these Keys upon a key press are not being logged to the 
WEEvent viewer nor spoken by WindowEyes as they should be from my understanding.

      It sounds like perhaps WindowEyes is getting the Key Press messages and 
trying to process them except that it might not know what to do with the 
message after getting it back from my script - just a wild guess from a novice 
but all I have at this point.

      One thing that might cause this could be that the vb.net IML or internal 
marshalling operations are not passing the correct data type to WindowEyes upon 
returnning from a OnKeyDown and, or, OnKeyUp Event handler function if 
necessary.

      So, if I know  exactly what system 32, or whatever, data type is expected 
and how it is used I might be able to pick a corresponding data type and use 
MarshalAs Attribute to try and return it.

      Thanks:

      Rick USA

Reply via email to