ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.16 by pcg, Wed Dec 17 09:00:35 2003 UTC vs.
Revision 1.17 by pcg, Thu Dec 18 00:29:29 2003 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: command.c 2 * File: command.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: command.C,v 1.16 2003/12/17 09:00:35 pcg Exp $ 4 * $Id: command.C,v 1.17 2003/12/18 00:29:29 pcg Exp $
5 * 5 *
6 * All portions of code are copyright by their respective author/s. 6 * All portions of code are copyright by their respective author/s.
7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
8 * - original version 8 * - original version
9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> 9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com>
88 if (R->Input_Context) 88 if (R->Input_Context)
89 { 89 {
90 Status status_return; 90 Status status_return;
91 91
92#ifdef X_HAVE_UTF8_STRING 92#ifdef X_HAVE_UTF8_STRING
93 len = Xutf8LookupString(R->Input_Context, ev, (char *)kbuf, 93 len = Xutf8LookupString (R->Input_Context, ev, (char *)kbuf,
94 KBUFSZ, &keysym, &status_return); 94 KBUFSZ, &keysym, &status_return);
95#else 95#else
96 wchar_t wkbuf[KBUFSZ + 1];
97
98 // assume wchar_t == unicode or better
96 len = XmbLookupString(R->Input_Context, ev, (char *)kbuf, 99 len = XwcLookupString (R->Input_Context, ev, wkbuf,
97 KBUFSZ, &keysym, &status_return); 100 KBUFSZ, &keysym, &status_return);
101
102 if (status_return == XLookupChars
103 || status_return == XLookupBoth)
104 {
105 wkbuf[len] = 0;
106 len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
107 }
108 else
109 len = 0;
98#endif 110#endif
99 valid_keysym = ((status_return == XLookupKeySym) 111 valid_keysym = status_return == XLookupKeySym
100 || (status_return == XLookupBoth)); 112 || status_return == XLookupBoth;
101 } 113 }
102 else 114 else
103#endif 115#endif
104 { 116 {
105 len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym, &R->compose); 117 len = XLookupString (ev, (char *)kbuf, KBUFSZ, &keysym, &R->compose);
106 valid_keysym = !len; 118 valid_keysym = !len;
107 } 119 }
108 120
109 if (valid_keysym) 121 if (valid_keysym)
110 { 122 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines