+2003-04-10 Bill Haneman <bill.haneman@sun.com>
+
+ * registryd/deviceeventcontroller.c:
+ (spi_keystroke_from_x_key_event):
+ Instead of checking to see if the keysym is
+ printable, check the string from XLookupString
+ if available, get the first unicode character from it,
+ and call g_unichar_isprint to determine whether the
+ is_text flag should be TRUE or FALSE.
+
+ Fix for bug 110419.
+
2003-04-02 Padraig O'Briain <padraig.obriain@sun.com>
* atk-bridge/bridge.c: Add support for extended events
*
* (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
*
- * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2003 Sun Microsystems Inc.,
* Copyright 2001, 2002 Ximian, Inc.
*
* This library is free software; you can redistribute it and/or
key_event.event_string = CORBA_string_dup ("space");
break;
case XK_Tab:
-#ifdef SPI_KEYEVENT_DEBUG
- fprintf(stderr, "Tab\n");
-#endif
key_event.event_string = CORBA_string_dup ("Tab");
break;
case XK_BackSpace:
default:
if (nbytes > 0)
{
+ gunichar c;
cbuf[nbytes] = '\0'; /* OK since length is cbuf_bytes+1 */
key_event.event_string = CORBA_string_dup (cbuf);
- if ((keysym && g_ascii_isprint (keysym)) || (nbytes == 1))
+ c = g_utf8_get_char_validated (cbuf, nbytes);
+ if ((c > 0) && g_unichar_isprint (c))
{
key_event.is_text = CORBA_TRUE;
- /* FIXME: incorrect for some composed chars, unicode chars? */
+ /* incorrect for some composed chars? */
}
}
else
key_event.timestamp = (CORBA_unsigned_long) x_key_event->time;
#ifdef SPI_KEYEVENT_DEBUG
fprintf (stderr,
- "Key %lu pressed (%c), modifiers %d\n",
- (unsigned long) keysym,
- keysym ? (int) keysym : '*',
- (int) x_key_event->state);
+ "Key %lu pressed (%c), modifiers %d; string=%s [%x] %s\n",
+ (unsigned long) keysym,
+ keysym ? (int) keysym : '*',
+ (int) x_key_event->state,
+ key_event.event_string,
+ key_event.event_string[0],
+ (key_event.is_text == CORBA_TRUE) ? "(text)" : "(not text)");
#endif
#ifdef SPI_DEBUG
fprintf (stderr, "%s%c",