WtLookupString Function
Maps a KeyPress or KeyRelease event to its KeyEvent structure (and optionally, to its Keysym) when a user presses a key.
Usage
string = WtLookupString(event)
Input Parameters
event — A KeyEvent structure associated with the KeyPress event. The KeyEvent structure is passed to the callback procedure.
Returned Value
string — A string containing the name of the key which was pressed. A null string is returned for the <Shift>
, <Ctrl>
, <Alt>
, and function keys.
Keywords
Keysym — Returns a value associated with the key pressed.
Discussion
WtLookupString is used in the callback of a KeyPress or KeyRelease event to map the event into the string it represents. The call is used specifically to handle null strings, which are returned whenever an unprintable character (such as <Shift>, or a function key) is pressed.
Keysym is used in situations where the pressed key must be identified. The include file <X11/keysymdef.h>
contains a complete Keysym listing.
Examples
The following example illustrates the use of WtLookupString to obtain the string name associated with a KeyPress event.
string = WtLookupString(event)
The following usage of WtLookupString returns the string associated with the event as well as the Keysym associated with the key pressed.
string = WtLookupString(event, keysym=ks)
See Also
For detailed information on GUI development, refer to the PV‑WAVE Application Developer’s Guide.
For more information about how to write an application program based on PV‑WAVE Widgets, refer to Using Wave Widgets in the PV‑WAVE Application Developer’s Guide.
For detailed information on Keysyms, see Appendix H, “Keysyms,” of the Xlib Reference Manual (Vol. 2) for Version 11 (O’Reilly & Associates, 1988).