12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTChapter 16Application Utility FunctionsOnce you have initialized the X system, you can use the <strong>Xlib</strong> utility functions to:• Use keyboard utility functions• Use Latin-1 keyboard event functions• Allocate permanent storage• Parse the window geometry• Manipulate regions• Use cut buffers• Determine the appropriate visual type• Manipulate images• Manipulate bitmaps• Use the context managerAs a group, the functions discussed in this chapter provide the functionality that is frequentlyneeded and that spans toolkits. Many ofthese functions do not generate actual protocol requeststo the server.16.1. Using Keyboard Utility FunctionsThis section discusses mapping between KeyCodes and KeySyms, classifying KeySyms, andmapping between KeySyms and string names. The first three functions in this section operate onacached copy ofthe server keyboard mapping. The first four KeySyms for each KeyCode aremodified according to the rules given insection 12.7. To obtain the untransformed KeySymsdefined for a key, use the functions described in section 12.7.To obtain a KeySym for the KeyCode of an event, use XLookupKeysym.KeySym XLookupKeysym(key_event, index)XKeyEvent *key_event;int index;key_eventindexSpecifies the KeyPress or KeyRelease event.Specifies the index into the KeySyms list for the event’s KeyCode.The XLookupKeysym function uses a given keyboard event and the index you specified toreturn the KeySym from the list that corresponds to the KeyCode member in the XKeyPressedEventor XKeyReleasedEvent structure. If no KeySym is defined for the KeyCode of the event,XLookupKeysym returns NoSymbol.To obtain a KeySym for a specific KeyCode, use XKeycodeToKeysym.400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!