+ command_key_listener = createAccessibleKeystrokeListener (report_command_key_event, NULL);
+ ordinary_key_listener = createAccessibleKeystrokeListener (report_ordinary_key_event, NULL);
+
+ /* will listen only to Alt-key combinations, and only to KeyPress events */
+ registerAccessibleKeystrokeListener(command_key_listener,
+ (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
+ SPI_KEYMASK_ALT,
+ (unsigned long) ( KeyPress ),
+ SPI_KEYLISTENER_ALL_WINDOWS);
+
+ /* will listen only to unshifted key events, both press and release */
+ registerAccessibleKeystrokeListener(ordinary_key_listener,
+ (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
+ SPI_KEYMASK_UNMODIFIED,
+ (unsigned long) ( KeyPress | KeyRelease),
+ SPI_KEYLISTENER_NOSYNC);
+
+ /* will listen only to shifted key events, both press and release */
+ registerAccessibleKeystrokeListener(ordinary_key_listener,
+ (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
+ SPI_KEYMASK_SHIFT,
+ (unsigned long) ( KeyPress | KeyRelease),
+ SPI_KEYLISTENER_NOSYNC);
+
+ get_environment_vars ();
+
+ SPI_event_main ();
+
+ setenv ("AT_BRIDGE_SHUTDOWN", "1", TRUE);
+
+ return SPI_exit ();