I have successfully added a keylistener but I would really like to be
informed by caret movements - even if they are triggered by the mouse.

Has anyone ever listened to the the CARET_CHANGED event?


If you are fine with getting notified for just mouse click and key
events inside the document window you can use the
com.sun.star.awt.XUserInputInteraction interface that is supported by
the Controller objects of each document.

If you just want to track if the document cursor is moved around a
SelectionChanged listener might be appropriate also.

What I would really like to do is knowing where the user is currently
active - that is where the keyboard focus is and where the caret is.

I guess a selection listener would be ok, if I could add it globally,
but can you do that?


What means "globally"? A listener always must be registered at an
object, TANSTAAGL ("There is no such things as a global listener" ;-))
if that should mean you can just say "gimme all events".

I am sorry if I am being too vague. By global I meant in the context of the openoffice system. I had hoped I could add a listener to something like the com.sun.star.awt.XExtendedToolkit which fits my definition of "global" ;-)

The XExtendedToolkit supports an XFocusListener which should "keep track of the object that currently has the input focus.", but it does not seem to track the keyboard input focus (e.g. you do not get focus events when changing between two Writer windows).

You always need a source to register for the events. Event sources for
user interactions in the OOo API usually are windows but their current
API only tracks events for each windows separately, you won't get events
for a complete window hierarchy. For this reason we added an API above a
complete window hierarchy inside a document window, the
XUserInputInteraction interface. Each Controller object that controls a
single document window implements this, having a single event source for
all windows seems to be a real mess IMHO.

I like your honest opinion and I could not agree more. If I could just add a top-level (global :-)) listener which could inform me of the active window then I would be more than happy to add a second listener to that window.


I still don't understand your goal, the "where" in your sentence


I create Assistive Technologies (AT) to help users write/read text in their favorite programs. On Windows I have so far been able to use the Microsoft Accessiblity API (MSAA) to keep track of user focus and caret movements. I am now trying to figure out whether I can support OpenOffice on Windows, but as OpenOffice does not yet support MSAA I have to come up with an alternative way to figure out where the user is writing (I cannot help the user if I do not know where she is ;-)).


What I would really like to do is knowing where the user is currently
active - that is where the keyboard focus is and where the caret is.


is too general and unspecific to me: is it enough to know in which
document window the cursor is and which element inside the window is
selected or at which position the cursor is set? Or are you also
interested to get a notification when the user clicks into scroll bars,
toolbars, dialogs, menues etc.?

I am only interested in the keyboard focus and textselections. If the caret moves (by means of the keyboard, mouse or whatever) I would like to be able to retrieve the text in which the caret has now been placed, so that I might be able to help the user doing wordprediction and the like. That is if the user places the keyboard focus in a Writer document I would like to be able to find the document and the position of the caret.

I think I might be able to do some of this using the JAA bridge, but if it can be done using the JAA bridge one must be able to do it using only the OpenOffice API as well!?

Am I making any sense?

Thanks for your reply.

best regards

W





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to