Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xlookupkeysym(3x) [hpux man page]

XLookupKeysym() 														   XLookupKeysym()

Name
  XLookupKeysym - get the keysym corresponding to a keycode in structure.

Synopsis
  KeySym XLookupKeysym(event, index)
	XKeyEvent *event;
	int index;

Arguments
  event   Specifies the KeyPress or KeyRelease event that is to be used.

  index   Specifies  which  keysym  from the list associated with the keycode in the event to return.  These correspond to the modifier keys,
	  and the symbols ShiftMapIndex, LockMapIndex, ControlMapIndex, Mod1MapIndex, Mod2MapIndex, Mod3MapIndex, Mod4MapIndex, and  Mod5Map-
	  Index can be used.

Returns
  The keysym.

Description
  Given  a keyboard event and the index into the list of keysyms for that keycode, XLookupKeysym() returns the keysym from the list that cor-
  responds to the keycode in the event.  If no keysym is defined for the keycode of the event, XLookupKeysym() returns NoSymbol.

  Each keycode may have a list of associated keysyms, which are portable symbols representing the meanings of the key.	The  index  specifies
  which  keysym  in the list is desired, indicating the combination of modifier keys that are currently pressed.  Therefore, the program must
  interpret the state member of the XKeyEvent structure to determine the index before calling this function.  The exact mapping  of  modifier
  keys into the list of keysyms for each keycode is server-dependent beyond the fact that the first keysym corresponds to the keycode without
  modifier keys, and the second corresponds to the keycode with Shift pressed.

  XLookupKeysym() simply calls XKeycodeToKeysym(), using arguments taken from the specified event structure.

Structures
     typedef struct {
	 int type;		/* of event */
	 unsigned long serial;	/* # of last request processed by server */
	 Bool send_event;	/* true if this came from a SendEvent request */
	 Display *display;	/* display the event was read from */
	 Window window; 	/* "event" window it is reported relative to */
	 Window root;		/* root window that the event occured on */
	 Window subwindow;	/* child window */
	 Time time;		/* milliseconds */
	 int x, y;		/* pointer x, y coordinates in event window */
	 int x_root, y_root;	/* coordinates relative to root */
	 unsigned int state;	/* key or button mask */
	 unsigned int keycode;	/* detail */
	 Bool same_screen;	/* same screen flag */
     } XKeyEvent;

See Also
  XChangeKeyboardMapping(),  XDeleteModifiermapEntry(),  XFreeModifiermap(),   XGetKeyboardMapping(),	XGetModifierMapping(),	 XInsertModi-
  fiermapEntry(),  XKeycodeToKeysym(),	XKeysymToKeycode(),  XKeysymToString(),  XLookupString(), XNewModifiermap(), XQueryKeymap(), XRebind-
  Keysym(), XRefreshKeyboardMapping(), XSetModifierMapping(), XStringToKeysym().

Xlib - Keyboard 														   XLookupKeysym()

Check Out this Related Man Page

XChangeKeyboardMapping()												  XChangeKeyboardMapping()

Name
  XChangeKeyboardMapping - change the keyboard mapping.

Synopsis
  XChangeKeyboardMapping(display, first_keycode,
  keysyms_per_keycode, keysyms, num_codes)
	Display *display;
	int first_keycode;
	int keysyms_per_keycode;
	KeySym *keysyms;
	int num_keycodes;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  first_keycode
	   Specifies the first keycode that is to be changed.

  keysyms_per_keycode
	   Specifies the number of keysyms that the caller is supplying for each keycode.

  keysyms  Specifies a pointer to the list of keysyms.

  num_keycodes
	   Specifies the number of keycodes that are to be changed.

Description
  Starting  with  first_keycode, XChangeKeyboardMapping() defines the keysyms for the specified number of keycodes.  The symbols for keycodes
  outside   this   range   remain   unchanged.	  The	number	 of    elements    in	 the	keysyms    list    must    be	 keysyms_per_
  keycode * num_keycodes (else a BadValue error).  The specified first_keycode must be greater than or equal to min_keycode returned by XDis-
  playKeycodes() (see Appendix C, Macros) or a BadValue error results.	In addition, the following expression must be less than or  equal  to
  max_keycode as returned by XDisplayKeycodes(), or a BadValue error results:

     first_keycode + num_keycodes  - 1

  The keysym number N (counting from 0) for keycode K has the following index in the keysyms array (counting from 0):

     (K - first_keycode) * keysyms_per_keycode + N

  The specified keysyms_per_keycode can be chosen arbitrarily by the client to be large enough to hold all desired symbols.  A special keysym
  value of NoSymbol should be used to fill in unused elements for individual keycodes.	It is legal for NoSymbol  to  appear  in  nontrailing
  positions of the effective list for a keycode.

  XChangeKeyboardMapping() generates a MappingNotify event, sent to this and all other clients, since the keycode to keysym mapping is global
  to all clients.

Errors
  BadAlloc

  BadValue  first.keycode less than display->min_keycode.
	    display->max_keycode exceeded (see above).

See Also
  XDeleteModifiermapEntry(), XFreeModifiermap(), XGetKeyboardMapping(), XGetModifierMapping(), XInsertModifiermapEntry(), XKeycodeToKeysym(),
  XKeysymToKeycode(),  XKeysymToString(),  XLookupKeysym(),  XLookupString(),  XNewModifierMap,  XQueryKeymap(),  XRebindKeySym, XRefreshKey-
  boardMapping(), XSetModifierMapping(), XStringToKeysym().

Xlib - Keyboard 													  XChangeKeyboardMapping()
Man Page