Re: [g-a-devel]AccessibleKeystrokeListener and keys logging



Bonjour,
Le Mardi 26 Août 2003 15:19, Bill Haneman a écrit :
> Hi Bernard:

Thank you for your replies, I did not resonbd earlier because first it 
was my turn to be on holidays :-(, then I was demonstrating against 
software patents in Europe :-(

>
> You said, regarding KEYLISTENER sync types:
> > NOSYNC allows me to register my listeners, but I then steal the
> > event (I only want to log it and let the app consume it
> > afterwards)
>
> I am not sure I understand what you mean; if you aren't "consuming"
> the event, only snooping it, NOSYNC is probably what you want.  If
> you believe that the events are being consumed even though you have
> not specified CANCONSUME in your flags, then that would be a bug. 
> What exactly did you mean by your comment?  Perhaps we are
> misunderstanding each other here.

Sorry for not stating my goal clearly. I was to know was the user is 
doing, and how he is doing it. I decided to use At-SPI to log every 
GUI event and it's "context".
For now the context is the accessible informations about the widget 
source of the event, and the gui parents of the source. I also want 
to know how (mouse clic or which keystrokes) the event was triggered.
listening for "mouse:button" allows me to listen for the mouse click.
"keyboard:modifiers" allows me only to listen for modifiers 
keystrokes.
I thought AccessibleKestrokeLuistener would be the was to go.
Here is my code:
"
    AccessibleKeyMaskType keymaskTypes[]={SPI_KEYMASK_ALT, 
SPI_KEYMASK_CONTROL, SPI_KEYMASK_SHIFT, SPI_KEYMASK_SHIFTLOCK, 
SPI_KEYMASK_NUMLOCK, SPI_KEYMASK_UNMODIFIED,SPI_KEYMASK_ALT | 
SPI_KEYMASK_CONTROL}; // I cannot grab every combination, too boring 
:-(
      for (unsigned int i=0; i != sizeof(keymaskTypes)/sizeof( 
AccessibleKeyMaskType); ++i){
	std::cerr<<"keystroke registering"<<i<<": 
"<<SPI_registerAccessibleKeystrokeListener (callback_
										   ,SPI_KEYSET_ALL_KEYS
										   ,keymaskTypes[i]
											      ,	static_cast<unsigned long> ( SPI_KEY_PRESSED | 
SPI_KEY_RELEASED )									   
,static_cast<AccessibleKeyListenerSyncType>(SPI_KEYLISTENER_NOSYNC ) 
);
}
"

The funny thing is that the first registering fails (output 0), and 
the others succed BUT I do get keystroke notification when doing 
Alt-F on eog.
The problem is that eog does not get the Alt-F event, as the "File" 
menu is not displayed :-(
I can understand that the metacity does not allow me to register 
SPI_KEYMASK_ALT, but it does not explains the behavior I am 
witnessing, does it ?

Thank you for your help.

Bernard





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