home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xgetmodifiermapping.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  12.4 KB  |  331 lines

  1.  
  2.  
  3.  
  4. XChangeKeyboardMapping(3X11X)LIB FUNCTIOXNCShangeKeyboardMapping(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XChangeKeyboardMapping, XGetKeyboardMapping, XDisplayKey-
  9.        codes, XSetModifierMapping, XGetModifierMapping, XNewModi-
  10.        fiermap, XInsertModifiermapEntry, XDeleteModifiermapEntry,
  11.        XFreeModifierMap XModifierKeymap - manipulate keyboard
  12.        encoding and keyboard encoding structure
  13.  
  14. SSYYNNTTAAXX
  15.        XChangeKeyboardMapping(_d_i_s_p_l_a_y, _f_i_r_s_t___k_e_y_c_o_d_e,
  16.        _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)
  17.          Display *_d_i_s_p_l_a_y;
  18.          int _f_i_r_s_t___k_e_y_c_o_d_e;
  19.          int _k_e_y_s_y_m_s___p_e_r___k_e_y_c_o_d_e;
  20.          KeySym *_k_e_y_s_y_m_s;
  21.          int _n_u_m___c_o_d_e_s;
  22.  
  23.        KeySym *XGetKeyboardMapping(_d_i_s_p_l_a_y, _f_i_r_s_t___k_e_y_c_o_d_e, _k_e_y_-
  24.        _c_o_d_e___c_o_u_n_t,
  25.                    _k_e_y_s_y_m_s___p_e_r___k_e_y_c_o_d_e___r_e_t_u_r_n)
  26.          Display *_d_i_s_p_l_a_y;
  27.          KeyCode _f_i_r_s_t___k_e_y_c_o_d_e;
  28.          int _k_e_y_c_o_d_e___c_o_u_n_t;
  29.          int *_k_e_y_s_y_m_s___p_e_r___k_e_y_c_o_d_e___r_e_t_u_r_n;
  30.  
  31.        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,
  32.        _m_a_x___k_e_y_c_o_d_e_s___r_e_t_u_r_n)
  33.            Display *_d_i_s_p_l_a_y;
  34.            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;
  35.  
  36.        int XSetModifierMapping(_d_i_s_p_l_a_y, _m_o_d_m_a_p)
  37.            Display *_d_i_s_p_l_a_y;
  38.            XModifierKeymap *_m_o_d_m_a_p;
  39.  
  40.        XModifierKeymap *XGetModifierMapping(_d_i_s_p_l_a_y)
  41.          Display *_d_i_s_p_l_a_y;
  42.  
  43.  
  44.        XModifierKeymap *XNewModifiermap(_m_a_x___k_e_y_s___p_e_r___m_o_d)
  45.            int _m_a_x___k_e_y_s___p_e_r___m_o_d;
  46.  
  47.        XModifierKeymap *XInsertModifiermapEntry(_m_o_d_m_a_p, _k_e_y_-
  48.        _c_o_d_e___e_n_t_r_y, _m_o_d_i_f_i_e_r)
  49.         XModifierKeymap *_m_o_d_m_a_p;
  50.         KeyCode _k_e_y_c_o_d_e___e_n_t_r_y;
  51.         int _m_o_d_i_f_i_e_r;
  52.  
  53.        XModifierKeymap *XDeleteModifiermapEntry(_m_o_d_m_a_p, _k_e_y_-
  54.        _c_o_d_e___e_n_t_r_y, _m_o_d_i_f_i_e_r)
  55.         XModifierKeymap *_m_o_d_m_a_p;
  56.         KeyCode _k_e_y_c_o_d_e___e_n_t_r_y;
  57.         int _m_o_d_i_f_i_e_r;
  58.  
  59.        XFreeModifiermap(_m_o_d_m_a_p)
  60.            XModifierKeymap *_m_o_d_m_a_p;
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XChangeKeyboardMapping(3X11X)LIB FUNCTIOXNCShangeKeyboardMapping(3X11)
  71.  
  72.  
  73. AARRGGUUMMEENNTTSS
  74.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  75.  
  76.        _f_i_r_s_t___k_e_y_c_o_d_e
  77.          Specifies the first KeyCode that is to be
  78.          changed or returned.
  79.  
  80.        _k_e_y_c_o_d_e___c_o_u_n_t
  81.          Specifies the number of KeyCodes that are to be
  82.          returned.
  83.  
  84.        _k_e_y_c_o_d_e___e_n_t_r_y
  85.          Specifies the KeyCode.
  86.  
  87.        _k_e_y_s_y_m_s     Specifies an array of KeySyms.
  88.  
  89.        _k_e_y_s_y_m_s___p_e_r___k_e_y_c_o_d_e
  90.          Specifies the number of KeySyms per KeyCode.
  91.  
  92.        _k_e_y_s_y_m_s___p_e_r___k_e_y_c_o_d_e___r_e_t_u_r_n
  93.          Returns the number of KeySyms per KeyCode.
  94.  
  95.        _m_a_x___k_e_y_s___p_e_r___m_o_d
  96.          Specifies the number of KeyCode entries preallo-
  97.          cated to the modifiers in the map.
  98.  
  99.        _m_a_x___k_e_y_c_o_d_e_s___r_e_t_u_r_n
  100.          Returns the maximum number of KeyCodes.
  101.  
  102.        _m_i_n___k_e_y_c_o_d_e_s___r_e_t_u_r_n
  103.          Returns the minimum number of KeyCodes.
  104.  
  105.        _m_o_d_i_f_i_e_r     Specifies the modifier.
  106.  
  107.        _m_o_d_m_a_p     Specifies the _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure.
  108.  
  109.        _n_u_m___c_o_d_e_s Specifies the number of KeyCodes that are to be
  110.          changed.
  111.  
  112. DDEESSCCRRIIPPTTIIOONN
  113.        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
  114.        for the specified number of KeyCodes starting with
  115.        first_keycode.  The symbols for KeyCodes outside this
  116.        range remain unchanged.    The number of elements in keysyms
  117.        must be:
  118.  
  119.        num_codes * keysyms_per_keycode
  120.  
  121.        The specified first_keycode must be greater than or equal
  122.        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
  123.        error results.  In addition, the following expression must
  124.        be less than or equal to max_keycode as returned by
  125.        _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:
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XChangeKeyboardMapping(3X11X)LIB FUNCTIOXNCShangeKeyboardMapping(3X11)
  137.  
  138.  
  139.        first_keycode + num_codes - 1
  140.  
  141.        KeySym number N, counting from zero, for KeyCode K has the
  142.        following index in keysyms, counting from zero:
  143.  
  144.        (K - first_keycode) * keysyms_per_keycode + N
  145.  
  146.        The specified keysyms_per_keycode can be chosen arbitrar-
  147.        ily by the client to be large enough to hold all desired
  148.        symbols.     A special KeySym value of _N_o_S_y_m_b_o_l should be
  149.        used to fill in unused elements for individual KeyCodes.
  150.        It is legal for _N_o_S_y_m_b_o_l to appear in nontrailing posi-
  151.        tions of the effective list for a KeyCode.  _X_C_h_a_n_g_e_K_e_y_-
  152.        _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.
  153.  
  154.        There is no requirement that the X server interpret this
  155.        mapping.     It is merely stored for reading and writing by
  156.        clients.
  157.  
  158.        _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
  159.        errors.
  160.  
  161.        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
  162.        the specified number of KeyCodes starting with
  163.        first_keycode.  The value specified in first_keycode must
  164.        be greater than or equal to min_keycode as returned by
  165.        _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 addi-
  166.        tion, the following expression must be less than or equal
  167.        to max_keycode as returned by _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s:
  168.  
  169.        first_keycode + keycode_count - 1
  170.  
  171.        If this is not the case, a _B_a_d_V_a_l_u_e error results.  The
  172.        number of elements in the KeySyms list is:
  173.  
  174.        keycode_count * keysyms_per_keycode_return
  175.  
  176.        KeySym number N, counting from zero, for KeyCode K has the
  177.        following index in the list, counting from zero:
  178.        (K - first_code) * keysyms_per_code_return + N
  179.  
  180.        The X server arbitrarily chooses the
  181.        keysyms_per_keycode_return value to be large enough to
  182.        report all requested symbols.  A special KeySym value of
  183.        _N_o_S_y_m_b_o_l is used to fill in unused elements for individual
  184.        KeyCodes.  To free the storage returned by
  185.        _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.
  186.  
  187.        _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.
  188.  
  189.        The _X_D_i_s_p_l_a_y_K_e_y_c_o_d_e_s function returns the min-keycodes and
  190.        max-keycodes supported by the specified display.     The min-
  191.        imum number of KeyCodes returned is never less than 8, and
  192.        the maximum number of KeyCodes returned is never greater
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XChangeKeyboardMapping(3X11X)LIB FUNCTIOXNCShangeKeyboardMapping(3X11)
  203.  
  204.  
  205.        than 255.  Not all KeyCodes in this range are required to
  206.        have corresponding keys.
  207.  
  208.        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
  209.        the keys (if any) that are to be used as modifiers.  If it
  210.        succeeds, the X server generates a _M_a_p_p_i_n_g_N_o_t_i_f_y event,
  211.        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
  212.        at most 8 modifier keys.     If more than 8 are specified in
  213.        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.
  214.  
  215.        The modifiermap member of the _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure
  216.        contains 8 sets of max_keypermod KeyCodes, one for each
  217.        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,
  218.        _M_o_d_3, _M_o_d_4, and _M_o_d_5.  Only nonzero KeyCodes have meaning
  219.        in each set, and zero KeyCodes are ignored.  In addition,
  220.        all of the nonzero KeyCodes must be in the range specified
  221.        by min_keycode and max_keycode in the _D_i_s_p_l_a_y structure,
  222.        or a _B_a_d_V_a_l_u_e error results.
  223.  
  224.        An X server can impose restrictions on how modifiers can
  225.        be changed, for example, if certain keys do not generate
  226.        up transitions in hardware, if auto-repeat cannot be dis-
  227.        abled on certain keys, or if multiple modifier keys are
  228.        not supported.  If some such restriction is violated, the
  229.        status reply is _M_a_p_p_i_n_g_F_a_i_l_e_d, and none of the modifiers
  230.        are changed.  If the new KeyCodes specified for a modifier
  231.        differ from those currently defined and any (current or
  232.        new) keys for that modifier are in the logically down
  233.        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
  234.        of the modifiers is changed.
  235.  
  236.        _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
  237.        errors.
  238.  
  239.        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
  240.        newly created _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure that contains the
  241.        keys being used as modifiers.  The structure should be
  242.        freed after use by calling _X_F_r_e_e_M_o_d_i_f_i_e_r_m_a_p.  If only zero
  243.        values appear in the set for any modifier, that modifier
  244.        is disabled.
  245.  
  246.        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_-
  247.        _f_i_e_r_K_e_y_m_a_p structure for later use.
  248.  
  249.        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
  250.        KeyCode to the set that controls the specified modifier
  251.        and returns the resulting _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure
  252.        (expanded as needed).
  253.  
  254.        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
  255.        KeyCode from the set that controls the specified modifier
  256.        and returns a pointer to the resulting _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p
  257.        structure.
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. XChangeKeyboardMapping(3X11X)LIB FUNCTIOXNCShangeKeyboardMapping(3X11)
  269.  
  270.  
  271.        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_-
  272.        _f_i_e_r_K_e_y_m_a_p structure.
  273.  
  274. SSTTRRUUCCTTUURREESS
  275.        The _X_M_o_d_i_f_i_e_r_K_e_y_m_a_p structure contains:
  276.  
  277.        typedef struct {
  278.         int max_keypermod;    /* This server's max number of keys per modifier */
  279.         KeyCode *modifiermap;/* An 8 by max_keypermod array of the modifiers */
  280.        } XModifierKeymap;
  281.  
  282. DDIIAAGGNNOOSSTTIICCSS
  283.        _B_a_d_A_l_l_o_c     The server failed to allocate the requested
  284.          resource or server memory.
  285.  
  286.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  287.          values accepted by the request.  Unless a spe-
  288.          cific range is specified for an argument, the
  289.          full range defined by the argument's type is
  290.          accepted.  Any argument defined as a set of
  291.          alternatives can generate this error.
  292.  
  293. SSEEEE AALLSSOO
  294.        XFree(3X11), XSetPointerMapping(3X11)
  295.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.