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
static AccessibleEventListener *button_listener;
static AccessibleKeystrokeListener *command_key_listener;
static AccessibleKeystrokeListener *ordinary_key_listener;
+static AccessibleKeySet *command_keyset;
int
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,
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);