deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* $XFree86: $
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This module converts keysym values into the corresponding ISO 10646
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * (UCS, Unicode) values.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The array keysymtab[] contains pairs of X11 keysym values for graphical
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * characters and the corresponding Unicode value. The function
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * therefore keysymtab[] must remain SORTED by keysym value.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * The keysym -> UTF-8 conversion will hopefully one day be provided
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * by Xlib via XmbLookupString() and should ideally not have to be
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * done in X applications. But we are not there yet.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * We allow to represent any UCS character in the range U-00000000 to
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This admittedly does not cover the entire 31-bit space of UCS, but
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * it does cover all of the characters up to U-10FFFF, which can be
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * represented by UTF-16, and more, and it is very unlikely that higher
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * UCS codes will ever be assigned by ISO. So to get Unicode character
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * U+ABCD you can directly use keysym 0x0100abcd.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * an initial draft of the mapping table.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This software is in the public domain. Share and enjoy!
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef KEYSYM2UCS_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define KEYSYM2UCS_H 1
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern long keysym2ucs(int keysym);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int ucs2keysym(long ucs);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* KEYSYM2UCS_H */