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