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