


XChangeKeyboardMapping(3X11)			 XChangeKeyboardMapping(3X11)
X11R5									X11R5



NAME
  XChangeKeyboardMapping, XGetKeyboardMapping, XDisplayKeycodes, XSetModifi-
  erMapping, XGetModifierMapping, XNewModifiermap, XInsertModifiermapEntry,
  XDeleteModifiermapEntry, XFreeModifierMap, XModifierKeymap - Manipulate
  keyboard encoding and	keyboard encoding structure

SYNTAX
  XChangeKeyboardMapping(_d_i_s_p_l_a_y, _f_i_r_s_t__k_e_y_c_o_d_e, _k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e,
  _k_e_y_s_y_m_s, _n_u_m__c_o_d_e_s)
	Display	*_d_i_s_p_l_a_y;
	int _f_i_r_s_t__k_e_y_c_o_d_e;
	int _k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e;
	KeySym *_k_e_y_s_y_m_s;
	int _n_u_m__c_o_d_e_s;

  KeySym *XGetKeyboardMapping(_d_i_s_p_l_a_y, _f_i_r_s_t__k_e_y_c_o_d_e, _k_e_y_c_o_d_e__c_o_u_n_t,
			      _k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	KeyCode	_f_i_r_s_t__k_e_y_c_o_d_e;
	int _k_e_y_c_o_d_e__c_o_u_n_t;
	int *_k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e__r_e_t_u_r_n;

  XDisplayKeycodes(_d_i_s_p_l_a_y, _m_i_n__k_e_y_c_o_d_e_s__r_e_t_u_r_n, _m_a_x__k_e_y_c_o_d_e_s__r_e_t_u_r_n)
	  Display *_d_i_s_p_l_a_y;
	  int *_m_i_n__k_e_y_c_o_d_e_s__r_e_t_u_r_n, *_m_a_x__k_e_y_c_o_d_e_s__r_e_t_u_r_n;

  int XSetModifierMapping(_d_i_s_p_l_a_y, _m_o_d_m_a_p)
	  Display *_d_i_s_p_l_a_y;
	  XModifierKeymap *_m_o_d_m_a_p;

  XModifierKeymap *XGetModifierMapping(_d_i_s_p_l_a_y)
	Display	*_d_i_s_p_l_a_y;


  XModifierKeymap *XNewModifiermap(_m_a_x__k_e_y_s__p_e_r__m_o_d)
	  int _m_a_x__k_e_y_s__p_e_r__m_o_d;

  XModifierKeymap *XInsertModifiermapEntry(_m_o_d_m_a_p, _k_e_y_c_o_d_e__e_n_t_r_y, _m_o_d_i_f_i_e_r)
       XModifierKeymap *_m_o_d_m_a_p;
       KeyCode _k_e_y_c_o_d_e__e_n_t_r_y;
       int _m_o_d_i_f_i_e_r;

  XModifierKeymap *XDeleteModifiermapEntry(_m_o_d_m_a_p, _k_e_y_c_o_d_e__e_n_t_r_y, _m_o_d_i_f_i_e_r)
       XModifierKeymap *_m_o_d_m_a_p;
       KeyCode _k_e_y_c_o_d_e__e_n_t_r_y;
       int _m_o_d_i_f_i_e_r;

  XFreeModifiermap(_m_o_d_m_a_p)
	  XModifierKeymap *_m_o_d_m_a_p;



ARGUMENTS

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _f_i_r_s_t__k_e_y_c_o_d_e
	    Specifies the first	KeyCode	that is	to be changed or returned.

  _k_e_y_c_o_d_e__c_o_u_n_t
	    Specifies the number of KeyCodes that are to be returned.

  _k_e_y_c_o_d_e__e_n_t_r_y
	    Specifies the KeyCode.

  _k_e_y_s_y_m_s   Specifies an array of KeySyms.

  _k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e
	    Specifies the number of KeySyms per	KeyCode.

  _k_e_y_s_y_m_s__p_e_r__k_e_y_c_o_d_e__r_e_t_u_r_n
	    Returns the	number of KeySyms per KeyCode.

  _m_a_x__k_e_y_s__p_e_r__m_o_d
	    Specifies the number of KeyCode entries preallocated to the
	    modifiers in the map.

  _m_a_x__k_e_y_c_o_d_e_s__r_e_t_u_r_n
	    Returns the	maximum	number of KeyCodes.

  _m_i_n__k_e_y_c_o_d_e_s__r_e_t_u_r_n
	    Returns the	minimum	number of KeyCodes.

  _m_o_d_i_f_i_e_r  Specifies the modifier.

  _m_o_d_m_a_p    Specifies the _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure.

  _n_u_m__c_o_d_e_s Specifies the number of KeyCodes that are to be changed.

DESCRIPTION
  The _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g function defines the symbols for the specified
  number of KeyCodes starting with first_keycode.  The symbols for KeyCodes
  outside this range remain unchanged. The number of elements in keysyms must
  be:

  num_codes * keysyms_per_keycode

  The specified	first_keycode must be greater than or equal to min_keycode
  returned by _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s,	or a _B_a_d_V_a_l_u_e error results.  In addition,
  the following	expression must	be less	than or	equal to max_keycode as
  returned by _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s,	or a _B_a_d_V_a_l_u_e error results:

  first_keycode	+ num_codes - 1

  KeySym number	N, counting from zero, for KeyCode K has the following index
  in keysyms, counting from zero:

  (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
  _N_o_S_y_m_b_o_l should be used to fill in unused elements for individual KeyCodes.
  It is	legal for _N_o_S_y_m_b_o_l to appear in	nontrailing positions of the effec-
  tive list for	a KeyCode.  _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g generates a _M_a_p_p_i_n_g_N_o_t_i_f_y
  event.

  There	is no requirement that the X server interpret this mapping. It is
  merely stored	for reading and	writing	by clients.

  _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g can generate _B_a_d_A_l_l_o_c and _B_a_d_V_a_l_u_e errors.

  The _X_G_e_t_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g function returns the symbols for the specified
  number of KeyCodes starting with first_keycode.  The value specified in
  first_keycode	must be	greater	than or	equal to min_keycode as	returned by
  _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s, or a _B_a_d_V_a_l_u_e error	results.  In addition, the following
  expression must be less than or equal	to max_keycode as returned by
  _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s:

  first_keycode	+ keycode_count	- 1

  If this is not the case, a _B_a_d_V_a_l_u_e error results. The number	of elements
  in the KeySyms list is:

  keycode_count	* keysyms_per_keycode_return

  KeySym number	N, counting from zero, for KeyCode K has the following index
  in the list, counting	from zero:

  (K - first_code) * keysyms_per_code_return + N

  The X	server arbitrarily chooses the keysyms_per_keycode_return value	to be
  large	enough to report all requested symbols.	A special KeySym value of
  _N_o_S_y_m_b_o_l is used to fill in unused elements for individual KeyCodes.	To
  free the storage returned by _X_G_e_t_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g, use	_X_F_r_e_e.

  _X_G_e_t_K_e_y_b_o_a_r_d_M_a_p_p_i_n_g can generate a _B_a_d_V_a_l_u_e error.

  The _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s function	returns	the min-keycodes and max-keycodes
  supported by the specified display.  The minimum number of KeyCodes
  returned is never less than 8, and the maximum number	of KeyCodes returned
  is never greater than	255.  Not all KeyCodes in this range are required to
  have corresponding keys.

  The _X_S_e_t_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g function specifies the KeyCodes of the keys (if
  any) that are	to be used as modifiers.  If it	succeeds, the X	server gen-
  erates a _M_a_p_p_i_n_g_N_o_t_i_f_y event,	and _X_S_e_t_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g	returns	_M_a_p_p_i_n_g_S_u_c_-
  _c_e_s_s.	 X permits at most eight modifier keys.	 If more than eight are
  specified in the _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure, a	_B_a_d_L_e_n_g_t_h error	results.

  The modifiermap member of the	_X_M_o_d_i_f_i_e_r_K_e_y_m_a_p	structure contains eight sets
  of max_keypermod KeyCodes, one for each modifier in the order	_S_h_i_f_t, _L_o_c_k,
  _C_o_n_t_r_o_l, _M_o_d_1, _M_o_d_2, _M_o_d_3, _M_o_d_4, and _M_o_d_5.  Only nonzero KeyCodes have
  meaning in each set, and zero	KeyCodes are ignored.  In addition, all	of
  the nonzero KeyCodes must be in the range specified by min_keycode and
  max_keycode in the _D_i_s_p_l_a_y structure,	or a _B_a_d_V_a_l_u_e error results.

  An X server can impose restrictions on how modifiers can be changed, for
  example, if certain keys do not generate up transitions in hardware, if
  auto-repeat cannot be	disabled on certain keys, or if	multiple modifier
  keys are not supported. If some such restriction is violated,	the status
  reply	is _M_a_p_p_i_n_g_F_a_i_l_e_d, and none of the modifiers are	changed.  If the new
  KeyCodes specified for a modifier differ from	those currently	defined	and
  any (current or new) keys for	that modifier are in the logically down
  state, _X_S_e_t_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g returns _M_a_p_p_i_n_g_B_u_s_y, and none of the modifiers
  is changed.

  _X_S_e_t_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g can generate _B_a_d_A_l_l_o_c and	_B_a_d_V_a_l_u_e errors.

  The _X_G_e_t_M_o_d_i_f_i_e_r_M_a_p_p_i_n_g function returns a pointer to	a newly	created	_X_M_o_-
  _d_i_f_i_e_r_K_e_y_m_a_p structure that contains the keys	being used as modifiers.  The
  structure should be freed after use by calling _X_F_r_e_e_M_o_d_i_f_i_e_r_m_a_p.  If only
  zero values appear in	the set	for any	modifier, that modifier	is disabled.


  The _X_N_e_w_M_o_d_i_f_i_e_r_m_a_p function returns a pointer to _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure
  for later use.

  The _X_I_n_s_e_r_t_M_o_d_i_f_i_e_r_m_a_p_E_n_t_r_y function adds the	specified KeyCode to the set
  that controls	the specified modifier and returns the resulting _X_M_o_d_i_f_i_-
  _e_r_K_e_y_m_a_p structure (expanded as needed).

  The _X_D_e_l_e_t_e_M_o_d_i_f_i_e_r_m_a_p_E_n_t_r_y function deletes the specified KeyCode from the
  set that controls the	specified modifier and returns a pointer to the
  resulting _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure.

  The _X_F_r_e_e_M_o_d_i_f_i_e_r_m_a_p function	frees the specified _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p struc-
  ture.

STRUCTURES
  The _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure	contains:

  typedef struct {
	  int max_keypermod;	  /* This server's max number of keys per modifier */
	  KeyCode *modifiermap;	  /* An	8 by max_keypermod array of the	modifiers */
  } XModifierKeymap;

DIAGNOSTICS

  _B_a_d_A_l_l_o_c  The	server failed to allocate the requested	resource or server
	    memory.

  _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of values accepted by
	    the	request.  Unless a specific range is specified for an argu-
	    ment, the full range defined by the	argument's type	is accepted.
	    Any	argument defined as a set of alternatives can generate this
	    error.

SEE ALSO
  XFree(3X11), XSetPointerMapping(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e	delim off




































