From 84c39d198f5f11a84cfe38bab7d1de8104f03982 Mon Sep 17 00:00:00 2001 From: billh Date: Tue, 18 Dec 2001 11:24:57 +0000 Subject: [PATCH] Added is_text member to Accessibility_DeviceEvent and AccessibleKeystroke, to indicate whether the event's 'event_string' or 'keystring' member is the name of a keysym, or a composed string. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@189 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 14 ++++++++++++++ at-bridge/bridge.c | 2 ++ atk-bridge/bridge.c | 2 ++ cspi/spi-listener.h | 1 + idl/Accessibility_Registry.idl | 1 + registryd/deviceeventcontroller.c | 6 +++++- 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 381989f..527aff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2001-12-17 Bill Haneman + * idl/Accessibility_Registry.idl: + Added boolean member 'is_text' to DeviceEvent. This is for the + use of key events, and helps prevent ambiguity between composed + key strings and keysym names, since both may potentially be + returned in the 'event_string' member. + + * at-bridge/bridge.c: + * registryd/deviceeventcontroller.c: + Use the 'is_text' member when notifying device event listeners. + Knon issue: composed characters are not dealt with correctly by + the global key listener implementation yet. + +2001-12-17 Bill Haneman + * at-bridge/bridge.c: Namespaced local static methods to spi_atk_bridge_* where previously named bridge_*, and spi_* elsewhere. diff --git a/at-bridge/bridge.c b/at-bridge/bridge.c index d506e33..bb9818b 100644 --- a/at-bridge/bridge.c +++ b/at-bridge/bridge.c @@ -352,10 +352,12 @@ spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent *keystroke, if (event->string) { keystroke->event_string = CORBA_string_dup (event->string); + keystroke->is_text = CORBA_TRUE; } else { keystroke->event_string = CORBA_string_dup (""); + keystroke->is_text = CORBA_FALSE; } switch (event->type) { diff --git a/atk-bridge/bridge.c b/atk-bridge/bridge.c index d506e33..bb9818b 100644 --- a/atk-bridge/bridge.c +++ b/atk-bridge/bridge.c @@ -352,10 +352,12 @@ spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent *keystroke, if (event->string) { keystroke->event_string = CORBA_string_dup (event->string); + keystroke->is_text = CORBA_TRUE; } else { keystroke->event_string = CORBA_string_dup (""); + keystroke->is_text = CORBA_FALSE; } switch (event->type) { diff --git a/cspi/spi-listener.h b/cspi/spi-listener.h index 427473a..61fa35c 100644 --- a/cspi/spi-listener.h +++ b/cspi/spi-listener.h @@ -30,6 +30,7 @@ typedef struct { long timestamp; AccessibleKeyEventType type; unsigned short modifiers; + SPIBoolean is_text; } AccessibleKeystroke; /* diff --git a/idl/Accessibility_Registry.idl b/idl/Accessibility_Registry.idl index 765979d..95bc6fb 100644 --- a/idl/Accessibility_Registry.idl +++ b/idl/Accessibility_Registry.idl @@ -183,6 +183,7 @@ module Accessibility { unsigned short modifiers; unsigned long timestamp; string event_string; + boolean is_text; }; typedef sequence< long > KeySet; diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 9d34a2a..2ccff17 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -453,7 +453,7 @@ spi_keystroke_from_x_key_event (XKeyEvent *x_key_event) key_event.type = Accessibility_KEY_RELEASED; } key_event.modifiers = (CORBA_unsigned_short)(x_key_event->state); - + key_event.is_text = CORBA_FALSE; switch (keysym) { case ' ': @@ -472,6 +472,10 @@ spi_keystroke_from_x_key_event (XKeyEvent *x_key_event) if (XLookupString (x_key_event, cbuf, cbuf_bytes, &keysym, NULL) > 0) { key_event.event_string = CORBA_string_dup (cbuf); + if (isgraph (keysym)) + { + key_event.is_text = CORBA_TRUE; /* FIXME: incorrect for some composed chars? */ + } } else { -- 2.7.4