* registryd/deviceeventcontroller.c:
(spi_keystroke_from_x_key_event):
+ Fix string and keysym return codes to match modifier state.
+ [bug #107256]
+
+2003-02-28 Bill Haneman <bill.haneman@sun.com>
+
+ * registryd/deviceeventcontroller.c:
+ (spi_keystroke_from_x_key_event):
Fix segv due to improper use of isprint(c). [bug #107254]
2003-02-24 Bill Haneman <bill.haneman@sun.com>
char cbuf [cbuf_bytes+1];
int nbytes;
- if (!x_key_event) g_error ("invalid key event!");
- keysym = XLookupKeysym (x_key_event, 0);
+ nbytes = XLookupString (x_key_event, cbuf, cbuf_bytes, &keysym, NULL);
key_event.id = (CORBA_long)(keysym);
key_event.hw_code = (CORBA_short) x_key_event->keycode;
if (((XEvent *) x_key_event)->type == KeyPress)
key_event.event_string = CORBA_string_dup ("Right");
break;
default:
- nbytes = XLookupString (x_key_event, cbuf, cbuf_bytes, &keysym, NULL);
if (nbytes > 0)
{
cbuf[nbytes] = '\0'; /* OK since length is cbuf_bytes+1 */
key_event.event_string = CORBA_string_dup (cbuf);
- if (keysym && g_ascii_isprint (keysym))
+ if ((keysym && g_ascii_isprint (keysym)) || (nbytes == 1))
{
- key_event.is_text = CORBA_TRUE; /* FIXME: incorrect for some composed chars? */
+ key_event.is_text = CORBA_TRUE;
+ /* FIXME: incorrect for some composed chars, unicode chars? */
}
}
else