That's exactly what I've done. Thanks Doug"

Ralf Kefferpuetz 
* Germany 
* MSN/Live: [email protected] * Aim: RalfKatEMC * Skype/Yahoo:
rkefferpuetz7747 * 


-----Original Message-----
From: Doug Geoffray [mailto:[email protected]] 
Sent: Thursday, November 18, 2010 6:29 PM
To: [email protected]
Subject: Re: Keyboard.RegisterCursorKey question

Ralf,

I see you found a workaround for your Total Commander case but just 
wanted to throw out what I would have tried.  In your cursor key 
callback your first line could be:

Keyboard.WaitForAllKeysUp()

This would stall your script until all keys are up and then continue 
once they are.  You may still need a little delay after this call but 
this would be a simple work around.

Regards,
Doug

On 11/18/2010 11:43 AM, Ralf Kefferpuetz wrote:
> Doug,
>
> thanks for your patience.
> It worked immediately in IE, but not in firefox. After putting in a sleep
> 500 it worked for me in firefox too.
> So, I have to revise my statement that the keyboard.registerCursorKey does
> not what we expect it to do ;-)
> In the meantime I understand why it can not work in the Total Commander
> script. The reason for that is that the path information, I'm looking for
> when hitting control-tab, only gets updated when the keys are released,
> both, the control and the tab key. That's why registerCursorKey did only
> give me the path info, I was before pressing control-tab.
> I found a workaround for that and now it works as expected.
>
> Many thanks,
>     Ralf
> Ralf Kefferpuetz
> * Germany
> * MSN/Live: [email protected] * Aim: RalfKatEMC * Skype/Yahoo:
> rkefferpuetz7747 *
>
> -----Original Message-----
> From: Doug Geoffray [mailto:[email protected]]
> Sent: Thursday, November 18, 2010 2:12 PM
> To: [email protected]
> Subject: Re: Keyboard.RegisterCursorKey question
>
> Ralf,
>
> I just popped up Immed and typed the following two lines:
>
> sub SpeakTitle(): speak "the new tab is "&  ActiveWindow.Title : End Sub
> Set x=Keyboard.RegisterCursorKey("Control-Tab", "SpeakTitle")
>
> I then brought up IE 8 and opened up a few tabs.  Then when I press
> control-tab I hear the correct title 100 percent of the time.  Can you
> try this test?
>
> Doug
>
> On 11/15/2010 2:56 PM, Ralf Kefferpuetz wrote:
>> Doug,
>>
>> here is a small example of the keyboard.registerCursorKey function
showing
>> that it does not fires up after the key goes to the application.
>>
>> dim cKey(2)
>> set cKey(0) = Keyboard.RegisterCursorkey("Control-Tab", "speakTitle",
>> ClientInformation.ApplicationProcess, "Key07")
>>
>> Sub speakTitle(myKeyId)
>> speak "  this is ralf his function: "&   activewindow.title
>> End Sub
>>
>> Now load this test script in firefox or in Internet Explorer and you will
>> see that it will not announce the correct tab. It will announce only the
>> title of the web side you are in before releasing the control tab key.
The
>> in the set file implemented cursor key for control-tab will announce the
>> correct title.
>>
>> Cheers,
>>      Ralf
>>
>> Ralf Kefferpuetz
>> * Germany
>> * MSN/Live: [email protected] * Aim: RalfKatEMC * Skype/Yahoo:
>> rkefferpuetz7747 *
>>
>>
>> -----Original Message-----
>> From: Doug Geoffray [mailto:[email protected]]
>> Sent: Monday, November 15, 2010 7:33 PM
>> To: [email protected]
>> Subject: Re: Keyboard.RegisterCursorKey question
>>
>> Ralf,
>>
>> As Lloyd suggested I'm sure this is just timing.  I had a caveat in my
>> first email where I said there is no way to guarantee the application
>> has done its thing.  We can only guarantee the application has seen the
>> key.  In your case it probably takes some time to go and scan all the
>> new files and populate the list.  So you could either put in some
>> arbitrary delay before reading or try and figure out a way to know when
>> it has actually changed before reading based on a screen change of some
>> sort.
>>
>> Doug
>>
>> On 11/15/2010 12:30 PM, Ralf Kefferpuetz wrote:
>>> Hello Doug,
>>>
>>> well, I have an application , a file manager (Total Commander),with tabs
>> in
>>> it. Hitting control-tab brings me to the next tab. Each tab changes the
>> list
>>> view with files, means the directory path of the list view. I simply
want
>> WE
>>> to announce the new path, which is related to a tab.
>>>
>>> I tried the following:
>>>
>>> dim cKey(2), KeyLabel
>>> set cKey(0) = Keyboard.RegisterCursorkey("Control-Tab", "currentPanel",
>>> ClientInformation.ApplicationProcess, "Key07")
>>>
>>> Sub currentPanel(myKeyId)
>>> ... code for reading the control which holds the path string...
>>> End Sub
>>>
>>> You see, it now always reads the path of the actual path, not the one
>> which
>>> is active after control-tab is released.
>>> I hope this explains a bit better what I'm trying to achieve.
>>>
>>> Cheers and thanks a lot,
>>>      Ralf
>>>
>>> Ralf Kefferpuetz
>>> * Germany
>>> * MSN/Live: [email protected] * Aim: RalfKatEMC * Skype/Yahoo:
>>> rkefferpuetz7747 *
>>>
>>> -----Original Message-----
>>> From: Doug Geoffray [mailto:[email protected]]
>>> Sent: Monday, November 15, 2010 2:59 PM
>>> To: [email protected]
>>> Subject: Re: Keyboard.RegisterCursorKey question
>>>
>>> Ralf,
>>>
>>> After reading this again I think I was confused on what you were asking.
>>>
>>> When you do a Keyboard.RegisterCursorKey the even fires after the
>>> application sees the key.  You stated it fires before which is not
>>> correct.  It only fires once and that is after the application see it.
>>>
>>> I was referring to cursoring keys which are part of the set file.  If
>>> you hook Application.OnCursorKey then what I said is true but that isn't
>>> what you are doing or asking.
>>>
>>> If this isn't what you want or need then maybe explaining exactly what
>>> you are wanting to do would help me give you better advice of how to get
>>> there.
>>>
>>> Doug
>>>
>>> On 11/15/2010 8:30 AM, Doug Geoffray wrote:
>>>> Ralf,
>>>>
>>>> When you register OnCursorKey it actually fires both before the
>>>> application sees it and after the application sees it.  Meaning you
>>>> are guaranteed to get the event twice with each single keypress.  The
>>>> IsBeforeApplication flag that gets sent to your event handler
>>>> indicates if it is firing before or after.
>>>>
>>>> Isn't this what you are asking for?
>>>>
>>>> But as an fyi, just because it fires after the application sees the
>>>> keypress, it doesn't guarantee the application did anything with it or
>>>> at least did anything with it yet.  However, normally it works fine.
>>>> Typical problems may be if the application is sluggish to
>>>> respond...say it is working over a slow network of some sorts for
>>>> example.
>>>>
>>>> Regards,
>>>> Doug
>>>>
>>>> On 11/14/2010 10:17 AM, Ralf Kefferpuetz wrote:
>>>>> Hello all,
>>>>>
>>>>> as far as I understand it right the Keyboard.RegisterCursorKey
>>>>> fireds the
>>>>> function, before  the cursorKey is passed to the application. Do we
> have
>>>>> something similar to Keyboard.RegisterCursorKey, but it should fire
>>>>> up after
>>>>> the  key is passed to the application?
>>>>>
>>>>> Many thanks,
>>>>>       Ralf
>>>>>
>>>>> Ralf Kefferpuetz
>>>>> * Germany
>>>>> * MSN/Live: [email protected] * Aim: RalfKatEMC * Skype/Yahoo:
>>>>> rkefferpuetz7747 *
>>>>>
>>>>>

Reply via email to