Re: [g-a-devel]AccessibleKeystrokeListener



bernard wrote:
> > > Things work much better now, but I'm puzzled by the modmask argument
> > > in SPI_registerAccessibleKeystrokeListener.
> > > I want to listen to *any* keystroke.

and Peter replied
 
> With the current architecture in X, listening to keystrokes is expensive -
> you should only listen for those you really need to get access to.  An
> alternate approach that would allow listenings to (and potentially filtering)
> all keystrokes at a low level would involve an X extension.  This is being
> worked on, but isn't yet available.  Hence the interface that you are using
> now.

What Peter said is true, if you wish to listen to all keystrokes at the
X level; and if you do, there are liable to be side-effects.  However if
you don't mind getting key notifications from cooperating "accessible"
applications only, you can safely get those sorts of key notifications
from at-spi, by passing the CSPI_KEYSET_ALL_KEYS macro in place of the
'keys' parameter to SPI_registerAccessibleKeystrokeListener().  Please
do NOT pass CSPI_KEYSET_ALL_KEYS if you also are using the
CSPI_KEYLISTENER_ALL_WINDOWS flag in the last argument, this is almost
guaranteed to fail.  If you are doing "notification"-type key snooping,
for instance for key echo, this should serve your purposes.  If however
you wish to intercept and possibly consume these key events before they
get to the currently-focussed application, you must pass either the
CSPI_KEYLISTENER_CAN_CONSUME flag or the CSPI_KEYLISTENER_ALL_WINDOWS
flag.  Passing the first is safer and produces fewer side-effects, but
will not catch keys passed to 'inaccessible' applications or keys which
are already the subject of another X grab, for instance keys that
control the window manager.  Also note that, for the time being, some
applications do not respect the CAN_CONSUME flag, for instance Java
applications, Mozilla, and StarOffice, although this support is planned
for the future.  You are strongly advised to restrict your use of the
ALL_WINDOWS flag to the minimum subset of command-and-control keys for
your assistive-technology client, since the X-level key interception
mechanism generates side-effects, at least until the X extension Peter
makes reference to becomes widely available. 
 

best regards,

Bill

> 
> Regards,
> 
> Peter Korn
> Sun Accessibility team
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]