keysym2ucs.h revision 706f2543
11.8Sbouyer/*
21.1Ssimonb * This module converts keysym values into the corresponding ISO 10646
31.1Ssimonb * (UCS, Unicode) values.
41.1Ssimonb *
51.1Ssimonb * The array keysymtab[] contains pairs of X11 keysym values for graphical
61.1Ssimonb * characters and the corresponding Unicode value. The function
71.1Ssimonb * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
81.1Ssimonb * therefore keysymtab[] must remain SORTED by keysym value.
91.1Ssimonb *
101.1Ssimonb * The keysym -> UTF-8 conversion will hopefully one day be provided
111.1Ssimonb * by Xlib via XmbLookupString() and should ideally not have to be
121.1Ssimonb * done in X applications. But we are not there yet.
131.1Ssimonb *
141.1Ssimonb * We allow to represent any UCS character in the range U-00000000 to
151.1Ssimonb * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
161.1Ssimonb * This admittedly does not cover the entire 31-bit space of UCS, but
171.1Ssimonb * it does cover all of the characters up to U-10FFFF, which can be
181.2Scgd * represented by UTF-16, and more, and it is very unlikely that higher
191.2Scgd * UCS codes will ever be assigned by ISO. So to get Unicode character
201.2Scgd * U+ABCD you can directly use keysym 0x0100abcd.
211.1Ssimonb *
221.1Ssimonb * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
231.1Ssimonb *
241.1Ssimonb * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
251.1Ssimonb * an initial draft of the mapping table.
261.1Ssimonb *
271.1Ssimonb * This software is in the public domain. Share and enjoy!
281.1Ssimonb */
291.1Ssimonb
301.1Ssimonb#ifndef KEYSYM2UCS_H
311.1Ssimonb#define KEYSYM2UCS_H 1
321.1Ssimonb
331.1Ssimonbextern long keysym2ucs(int keysym);
341.1Ssimonbextern int ucs2keysym(long ucs);
351.1Ssimonb
361.1Ssimonb#endif /* KEYSYM2UCS_H */
371.1Ssimonb