Changes to simple-at demo, to reduce clashes with WM and other existing
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 16 Jan 2002 12:12:34 +0000 (12:12 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 16 Jan 2002 12:12:34 +0000 (12:12 +0000)
keygrabs.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@223 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
test/simple-at.c

index 365b29a..2286cb7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2002-01-11  Bill Haneman <bill.haneman@sun.com>
 
-        * registryd/deviceeventcontroller.c:
+       * test/simple-at.c:
+       Changed simple-at to use a specific keyset, rather than
+       SPI_KEYSET_ALL_KEYS - this helps minimize clashes with the window
+       manager, desktop, etc.
+       
+2002-01-11  Bill Haneman <bill.haneman@sun.com>
+
+       * registryd/deviceeventcontroller.c:
        Replaced standard X error handler with a special handler that 
        is non-fatal for failed keygrabs.  This works around 
        problems with keygrab clashes sometimes observed on 
index 996a900..cf079c9 100644 (file)
@@ -50,6 +50,7 @@ static AccessibleEventListener *generic_listener;
 static AccessibleEventListener *button_listener;
 static AccessibleKeystrokeListener *command_key_listener;
 static AccessibleKeystrokeListener *ordinary_key_listener;
+static AccessibleKeySet            *command_keyset;
 
 int
 main (int argc, char **argv)
@@ -114,21 +115,16 @@ main (int argc, char **argv)
   /* prepare the keyboard snoopers */
   command_key_listener = SPI_createAccessibleKeystrokeListener (report_command_key_event, NULL);
   ordinary_key_listener = SPI_createAccessibleKeystrokeListener (report_ordinary_key_event, NULL);
+
+  command_keyset = SPI_createAccessibleKeySet (11, "qmf23456789", NULL, NULL);
   
-  /* will listen only to Control-Alt-key combinations, and only to KeyPress events */
+  /* will listen only to Control-Alt-q KeyPress events */
   SPI_registerAccessibleKeystrokeListener(command_key_listener,
-                                         (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
+                                         command_keyset,
                                          SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL,
                                          (unsigned long) ( SPI_KEY_PRESSED ),
                                          SPI_KEYLISTENER_ALL_WINDOWS);
 
-  /* will listen only to CAPSLOCK-Alt-key combinations, and only to KeyPress events */
-  SPI_registerAccessibleKeystrokeListener(command_key_listener,
-                                         (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
-                                         SPI_KEYMASK_ALT | SPI_KEYMASK_SHIFTLOCK,
-                                         (unsigned long) ( SPI_KEY_PRESSED ),
-                                         SPI_KEYLISTENER_ALL_WINDOWS);
-  
   /* will listen only to CAPSLOCK key events, both press and release */
   SPI_registerAccessibleKeystrokeListener(ordinary_key_listener,
                                          (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
@@ -319,10 +315,9 @@ simple_at_exit ()
   AccessibleEventListener_unref        (button_listener);
 
   SPI_deregisterAccessibleKeystrokeListener (command_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL);
-  SPI_deregisterAccessibleKeystrokeListener (command_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_SHIFTLOCK);
   AccessibleKeystrokeListener_unref         (command_key_listener);
+  SPI_freeAccessibleKeySet                  (command_keyset);
 
-  SPI_deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_UNMODIFIED);
   SPI_deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_SHIFTLOCK);
   AccessibleKeystrokeListener_unref         (ordinary_key_listener);