From: billh Date: Sat, 5 Jan 2002 17:23:32 +0000 (+0000) Subject: Enabled keygrabs of the Control key, and changed the command key modifier X-Git-Tag: AT_SPI2_ATK_2_12_0~1450 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7297746ac2519774c006fb0630ad62ebe032a086;hp=a5b8573ce92636e315d1bfe4af7a430782740b46;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git Enabled keygrabs of the Control key, and changed the command key modifier 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 --- diff --git a/ChangeLog b/ChangeLog index 5526be3..1c35935 100644 --- 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 + + * 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 * libspi/remoteobject.h: diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index a9ffd9d..16daff6 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -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; } diff --git a/test/simple-at.c b/test/simple-at.c index 35ffec3..149a5f4 100644 --- a/test/simple-at.c +++ b/test/simple-at.c @@ -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;