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

  1.  
  2.  
  3.  
  4. XChangeKeyboardControl(3X11X)LIB FUNCTIOXNCShangeKeyboardControl(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XChangeKeyboardControl, XGetKeyboardControl, XAutoRe-
  9.        peatOn, XAutoRepeatOff, XBell, XQueryKeymap, XKeyboardCon-
  10.        trol - manipulate keyboard settings and keyboard control
  11.        structure
  12.  
  13. SSYYNNTTAAXX
  14.        XChangeKeyboardControl(_d_i_s_p_l_a_y, _v_a_l_u_e___m_a_s_k, _v_a_l_u_e_s)
  15.          Display *_d_i_s_p_l_a_y;
  16.          unsigned long _v_a_l_u_e___m_a_s_k;
  17.          XKeyboardControl *_v_a_l_u_e_s;
  18.  
  19.        XGetKeyboardControl(_d_i_s_p_l_a_y, _v_a_l_u_e_s___r_e_t_u_r_n)
  20.          Display *_d_i_s_p_l_a_y;
  21.          XKeyboardState *_v_a_l_u_e_s___r_e_t_u_r_n;
  22.  
  23.        XAutoRepeatOn(_d_i_s_p_l_a_y)
  24.          Display *_d_i_s_p_l_a_y;
  25.  
  26.        XAutoRepeatOff(_d_i_s_p_l_a_y)
  27.          Display *_d_i_s_p_l_a_y;
  28.  
  29.        XBell(_d_i_s_p_l_a_y, _p_e_r_c_e_n_t)
  30.          Display *_d_i_s_p_l_a_y;
  31.          int _p_e_r_c_e_n_t;
  32.  
  33.        XQueryKeymap(_d_i_s_p_l_a_y, _k_e_y_s___r_e_t_u_r_n)
  34.          Display *_d_i_s_p_l_a_y;
  35.          char _k_e_y_s___r_e_t_u_r_n[32];
  36.  
  37. AARRGGUUMMEENNTTSS
  38.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  39.  
  40.        _k_e_y_s___r_e_t_u_r_n
  41.          Returns an array of bytes that identifies which
  42.          keys are pressed down.     Each bit represents one
  43.          key of the keyboard.
  44.  
  45.        _p_e_r_c_e_n_t     Specifies the volume for the bell, which can
  46.          range from -100 to 100 inclusive.
  47.  
  48.        _v_a_l_u_e___m_a_s_k
  49.          Specifies which controls to change.  This mask
  50.          is the bitwise inclusive OR of the valid control
  51.          mask bits.
  52.  
  53.        _v_a_l_u_e_s     Specifies one value for each bit set to 1 in the
  54.          mask.
  55.  
  56.        _v_a_l_u_e_s___r_e_t_u_r_n
  57.          Returns the current keyboard controls in the
  58.          specified _X_K_e_y_b_o_a_r_d_S_t_a_t_e structure.
  59.  
  60.  
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XChangeKeyboardControl(3X11X)LIB FUNCTIOXNCShangeKeyboardControl(3X11)
  71.  
  72.  
  73. DDEESSCCRRIIPPTTIIOONN
  74.        The _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l function controls the keyboard
  75.        characteristics defined by the _X_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l structure.
  76.        The value_mask argument specifies which values are to be
  77.        changed.
  78.  
  79.        _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l can generate _B_a_d_M_a_t_c_h and _B_a_d_V_a_l_u_e
  80.        errors.
  81.  
  82.        The _X_G_e_t_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l function returns the current con-
  83.        trol values for the keyboard to the _X_K_e_y_b_o_a_r_d_S_t_a_t_e struc-
  84.        ture.
  85.  
  86.        The _X_A_u_t_o_R_e_p_e_a_t_O_n function turns on auto-repeat for the
  87.        keyboard on the specified display.
  88.  
  89.        The _X_A_u_t_o_R_e_p_e_a_t_O_f_f function turns off auto-repeat for the
  90.        keyboard on the specified display.
  91.  
  92.        The _X_B_e_l_l function rings the bell on the keyboard on the
  93.        specified display, if possible.    The specified volume is
  94.        relative to the base volume for the keyboard.  If the
  95.        value for the percent argument is not in the range -100 to
  96.        100 inclusive, a _B_a_d_V_a_l_u_e error results.     The volume at
  97.        which the bell rings when the percent argument is nonnega-
  98.        tive is:
  99.  
  100.           base - [(base * percent) / 100] + percent
  101.  
  102.        The volume at which the bell rings when the percent argu-
  103.        ment is negative is:
  104.  
  105.           base + [(base * percent) / 100]
  106.  
  107.        To change the base volume of the bell, use
  108.        _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l.
  109.  
  110.        _X_B_e_l_l can generate a _B_a_d_V_a_l_u_e error.
  111.  
  112.        The _X_Q_u_e_r_y_K_e_y_m_a_p function returns a bit vector for the
  113.        logical state of the keyboard, where each bit set to 1
  114.        indicates that the corresponding key is currently pressed
  115.        down.  The vector is represented as 32 bytes.  Byte N
  116.        (from 0) contains the bits for keys 8N to 8N + 7 with the
  117.        least significant bit in the byte representing key 8N.
  118.  
  119.        Note that the logical state of a device (as seen by client
  120.        applications) may lag the physical state if device event
  121.        processing is frozen.
  122.  
  123. SSTTRRUUCCTTUURREESS
  124.        The _X_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l structure contains:
  125.  
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XChangeKeyboardControl(3X11X)LIB FUNCTIOXNCShangeKeyboardControl(3X11)
  137.  
  138.  
  139.        /* Mask bits for ChangeKeyboardControl */
  140.        #define     _K_B_K_e_y_C_l_i_c_k_P_e_r_c_e_n_t         (1L<<0)
  141.        #define     _K_B_B_e_l_l_P_e_r_c_e_n_t             (1L<<1)
  142.        #define     _K_B_B_e_l_l_P_i_t_c_h             (1L<<2)
  143.        #define     _K_B_B_e_l_l_D_u_r_a_t_i_o_n             (1L<<3)
  144.        #define     _K_B_L_e_d                 (1L<<4)
  145.        #define     _K_B_L_e_d_M_o_d_e             (1L<<5)
  146.        #define     _K_B_K_e_y                 (1L<<6)
  147.        #define     _K_B_A_u_t_o_R_e_p_e_a_t_M_o_d_e         (1L<<7)
  148.        /* Values */
  149.  
  150.        typedef struct {
  151.         int key_click_percent;
  152.         int bell_percent;
  153.         int bell_pitch;
  154.         int bell_duration;
  155.         int led;
  156.         int led_mode;    /* LedModeOn, LedModeOff */
  157.         int key;
  158.         int auto_repeat_mode;/* AutoRepeatModeOff, AutoRepeatModeOn,
  159.                    AutoRepeatModeDefault */
  160.        } XKeyboardControl;
  161.  
  162.        The key_click_percent member sets the volume for key
  163.        clicks between 0 (off) and 100 (loud) inclusive, if possi-
  164.        ble.  A setting of -1 restores the default.  Other nega-
  165.        tive values generate a _B_a_d_V_a_l_u_e error.
  166.  
  167.        The bell_percent sets the base volume for the bell between
  168.        0 (off) and 100 (loud) inclusive, if possible.  A setting
  169.        of -1 restores the default.  Other negative values gener-
  170.        ate a _B_a_d_V_a_l_u_e error.  The bell_pitch member sets the
  171.        pitch (specified in Hz) of the bell, if possible.  A set-
  172.        ting of -1 restores the default.     Other negative values
  173.        generate a _B_a_d_V_a_l_u_e error.  The bell_duration member sets
  174.        the duration of the bell specified in milliseconds, if
  175.        possible.  A setting of -1 restores the default.     Other
  176.        negative values generate a _B_a_d_V_a_l_u_e error.
  177.  
  178.        If both the led_mode and led members are specified, the
  179.        state of that LED is changed, if possible.  The led_mode
  180.        member can be set to _L_e_d_M_o_d_e_O_n or _L_e_d_M_o_d_e_O_f_f.  If only
  181.        led_mode is specified, the state of all LEDs are changed,
  182.        if possible.  At most 32 LEDs numbered from one are sup-
  183.        ported.    No standard interpretation of LEDs is defined.
  184.        If led is specified without led_mode, a _B_a_d_M_a_t_c_h error
  185.        results.
  186.  
  187.        If both the auto_repeat_mode and key members are speci-
  188.        fied, the auto_repeat_mode of that key is changed (accord-
  189.        ing to _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n, _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f, or
  190.        _A_u_t_o_R_e_p_e_a_t_M_o_d_e_D_e_f_a_u_l_t), if possible.  If only
  191.        auto_repeat_mode is specified, the global auto_repeat_mode
  192.        for the entire keyboard is changed, if possible, and does
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XChangeKeyboardControl(3X11X)LIB FUNCTIOXNCShangeKeyboardControl(3X11)
  203.  
  204.  
  205.        not affect the per-key settings.     If a key is specified
  206.        without an auto_repeat_mode, a _B_a_d_M_a_t_c_h error results.
  207.        Each key has an individual mode of whether or not it
  208.        should auto-repeat and a default setting for the mode.  In
  209.        addition, there is a global mode of whether auto-repeat
  210.        should be enabled or not and a default setting for that
  211.        mode.  When global mode is _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n, keys should
  212.        obey their individual auto-repeat modes.     When global mode
  213.        is _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f, no keys should auto-repeat.  An
  214.        auto-repeating key generates alternating _K_e_y_P_r_e_s_s and
  215.        _K_e_y_R_e_l_e_a_s_e events.  When a key is used as a modifier, it
  216.        is desirable for the key not to auto-repeat, regardless of
  217.        its auto-repeat setting.
  218.  
  219.        The _X_K_e_y_b_o_a_r_d_S_t_a_t_e structure contains:
  220.  
  221.        typedef struct {
  222.         int key_click_percent;
  223.         int bell_percent;
  224.         unsigned int bell_pitch, bell_duration;
  225.         unsigned long led_mask;
  226.         int global_auto_repeat;
  227.         char auto_repeats[32];
  228.        } XKeyboardState;
  229.  
  230.        For the LEDs, the least significant bit of led_mask corre-
  231.        sponds to LED one, and each bit set to 1 in led_mask indi-
  232.        cates an LED that is lit.  The global_auto_repeat member
  233.        can be set to _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n or _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f.  The
  234.        auto_repeats member is a bit vector.  Each bit set to 1
  235.        indicates that auto-repeat is enabled for the correspond-
  236.        ing key.     The vector is represented as 32 bytes.     Byte N
  237.        (from 0) contains the bits for keys 8N to 8N + 7 with the
  238.        least significant bit in the byte representing key 8N.
  239.  
  240. DDIIAAGGNNOOSSTTIICCSS
  241.        _B_a_d_M_a_t_c_h     Some argument or pair of arguments has the cor-
  242.          rect type and range but fails to match in some
  243.          other way required by the request.
  244.  
  245.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  246.          values accepted by the request.  Unless a spe-
  247.          cific range is specified for an argument, the
  248.          full range defined by the argument's type is
  249.          accepted.  Any argument defined as a set of
  250.          alternatives can generate this error.
  251.  
  252. SSEEEE AALLSSOO
  253.        XChangeKeyboardMapping(3X11), XSetPointerMapping(3X11)
  254.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.