Enabled keygrabs of the Control key, and changed the command key modifier
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Sat, 5 Jan 2002 17:23:32 +0000 (17:23 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Sat, 5 Jan 2002 17:23:32 +0000 (17:23 +0000)
set for the simple-at demo to "Ctrl-Alt" from the previous "Alt", to
reduce clashes with window manager commands, etc.

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

ChangeLog
registryd/deviceeventcontroller.c
test/simple-at.c

index 5526be3..1c35935 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,20 @@
        Added check to see if AtkObject is an SpiRemoteObject before
        creating an SpiAccessible.
        
+2002-05-01  Bill Haneman <bill.haneman@sun.com>
+
+       * registryd/deviceeventcontroller.c (spi_controller_grab_keyboard):
+       Enable keygrabs using the Control modifier, now that they are
+       working properly (they were previously disabled).
+
+       * test/simple-at.c:
+       Change the command keygrab for this demo to "Control+Alt", so as
+       to conflict with fewer other key commands on the system; this
+       means that the quit command for "simple-at" is now "Ctrl-Alt-q".
+
+       Removed a pointlessly-chatty keylistener for unshifted keys
+       (shifted keys are still reported).
+       
 2002-02-01  Bill Haneman <bill.haneman@sun.com>
 
        * libspi/remoteobject.h:
index a9ffd9d..16daff6 100644 (file)
@@ -595,22 +595,15 @@ spi_controller_grab_keyboard (SpiDeviceEventController *controller)
 #ifdef SPI_DEBUG
       fprintf (stderr, "mask=%lx\n", maskVal);
 #endif
-      if (!(maskVal & ControlMask))
-       {
-         XGrabKey (spi_get_display (),
-                   keyVal, 
-                   maskVal,
-                   root_window,
-                   True,
-                   GrabModeAsync,
-                   GrabModeAsync);
+      XGrabKey (spi_get_display (),
+               keyVal, 
+               maskVal,
+               root_window,
+               True,
+               GrabModeAsync,
+               GrabModeAsync);
          /* TODO: check call for errors and return FALSE if error occurs */
-       }
-      else
-        {
-         return FALSE; /* can't do control key yet */
-        }
-    }
+    } 
   return TRUE;
 }
 
index 35ffec3..149a5f4 100644 (file)
@@ -116,20 +116,13 @@ main (int argc, char **argv)
   command_key_listener = SPI_createAccessibleKeystrokeListener (report_command_key_event, NULL);
   ordinary_key_listener = SPI_createAccessibleKeystrokeListener (report_ordinary_key_event, NULL);
   
-  /* will listen only to Alt-key combinations, and only to KeyPress events */
+  /* will listen only to Control-Alt-key combinations, and only to KeyPress events */
   SPI_registerAccessibleKeystrokeListener(command_key_listener,
                                          (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
-                                         SPI_KEYMASK_ALT,
+                                         SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL,
                                          (unsigned long) ( SPI_KEY_PRESSED ),
                                          SPI_KEYLISTENER_ALL_WINDOWS);
   
-  /* will listen only to unshifted key events, both press and release */
-  SPI_registerAccessibleKeystrokeListener(ordinary_key_listener,
-                                         (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
-                                         SPI_KEYMASK_UNMODIFIED,
-                                         (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
-                                         SPI_KEYLISTENER_NOSYNC);
-                                     
   /* will listen only to shifted key events, both press and release */
   SPI_registerAccessibleKeystrokeListener(ordinary_key_listener,
                                          (AccessibleKeySet *) SPI_KEYSET_ALL_KEYS,
@@ -353,10 +346,12 @@ is_command_key (AccessibleKeystroke *key)
     case 'M':
     case 'm':
            use_magnifier = ! use_magnifier;
+            fprintf (stderr, "%ssing magnifier\n", use_magnifier ? "U" : "Not u");
            return TRUE;
     case 'F':
     case 'f':
            use_festival = ! use_festival;
+            fprintf (stderr, "%speech output\n", use_festival ? "S" : "No s");
            return TRUE;
     default:
            return FALSE;