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

  1.  
  2.  
  3.  
  4. XMODMAP(1)                           XMODMAP(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        xmodmap - utility for modifying keymaps in X
  9.  
  10. SSYYNNOOPPSSIISS
  11.        xxmmooddmmaapp [-options ...] [filename]
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.        The  _x_m_o_d_m_a_p  program is used to edit and display the key-
  15.        board _m_o_d_i_f_i_e_r _m_a_p and  _k_e_y_m_a_p  _t_a_b_l_e  that  are     used  by
  16.        client    applications   to  convert  event  keycodes  into
  17.        keysyms.     It  is     usually  run  from  the  user's  session
  18.        startup script to configure the keyboard according to per-
  19.        sonal tastes.
  20.  
  21. OOPPTTIIOONNSS
  22.        The following options may be used with _x_m_o_d_m_a_p:
  23.  
  24.        --ddiissppllaayy _d_i_s_p_l_a_y
  25.            This option specifies the host and display to use.
  26.  
  27.        --hheellpp   This  option indicates that a brief description of
  28.            the command line arguments should  be  printed  on
  29.            the  standard  error  channel.    This will be done
  30.            whenever     an  unhandled    argument  is   given   to
  31.            _x_m_o_d_m_a_p_.
  32.  
  33.        --ggrraammmmaarr
  34.            This option indicates that a help message describ-
  35.            ing the expression grammar used in files and  with
  36.            -e  expressions    should be printed on the standard
  37.            error.
  38.  
  39.        --vveerrbboossee
  40.            This option indicates that  _x_m_o_d_m_a_p  should  print
  41.            logging information as it parses its input.
  42.  
  43.        --qquuiieett  This  option  turns off the verbose logging.  This
  44.            is the default.
  45.  
  46.        --nn      This option  indicates  that  _x_m_o_d_m_a_p  should  not
  47.            change  the  mappings,  but should display what it
  48.            would  do,  like     _m_a_k_e_(_1_)  does    when  given  this
  49.            option.
  50.  
  51.        --ee _e_x_p_r_e_s_s_i_o_n
  52.            This  option  specifies    an  expression to be exe-
  53.            cuted.  Any number of expressions may be specified
  54.            from the command line.
  55.  
  56.        --ppmm     This  option  indicates    that the current modifier
  57.            map should be printed on the standard output.
  58.  
  59.        --ppkk     This option  indicates  that  the  current  keymap
  60.            table should be printed on the standard output.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XMODMAP(1)                           XMODMAP(1)
  71.  
  72.  
  73.        --ppkkee    This  option  indicates    that  the  current keymap
  74.            table should be printed on the standard output  in
  75.            the  form  of  expressions that can be fed back to
  76.            _x_m_o_d_m_a_p.
  77.  
  78.        --pppp     This option indicates that the current pointer map
  79.            should be printed on the standard output.
  80.  
  81.        --       A  lone    dash means that the standard input should
  82.            be used as the input file.
  83.  
  84.        The _f_i_l_e_n_a_m_e specifies a file containing     _x_m_o_d_m_a_p  expres-
  85.        sions  to  be  executed.     This file is usually kept in the
  86.        user's home directory with a name like _._x_m_o_d_m_a_p_r_c.
  87.  
  88. EEXXPPRREESSSSIIOONN GGRRAAMMMMAARR
  89.        The _x_m_o_d_m_a_p program reads a list of expressions and parses
  90.        them  all  before attempting to execute any of them.  This
  91.        makes it possible to refer to keysyms that are being rede-
  92.        fined  in  a  natural  way without having to worry as much
  93.        about name conflicts.
  94.  
  95.        kkeeyyccooddee _N_U_M_B_E_R == _K_E_Y_S_Y_M_N_A_M_E _._._.
  96.            The list of keysyms is assigned to  the    indicated
  97.            keycode (which may be specified in decimal, hex or
  98.            octal and can be determined  by    running     the  _x_e_v
  99.            program.
  100.  
  101.        kkeeyyccooddee aannyy == _K_E_Y_S_Y_M_N_A_M_E _._._.
  102.            If  no  existing     key  has  the    specified list of
  103.            keysyms assigned to it, a spare key  on    the  key-
  104.            board  is selected and the keysyms are assigned to
  105.            it.  The list of keysyms may be specified in deci-
  106.            mal, hex or octal.
  107.  
  108.        kkeeyyssyymm _K_E_Y_S_Y_M_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
  109.            The _K_E_Y_S_Y_M_N_A_M_E on the left hand side is translated
  110.            into matching keycodes used to perform the  corre-
  111.            sponding     set of kkeeyyccooddee expressions.  The list of
  112.            keysym names may     be  found  in    the  header  file
  113.            _<_X_1_1_/_k_e_y_s_y_m_d_e_f_._h_>  (without the _X_K__ prefix) or the
  114.            keysym database    _<_X_R_o_o_t_>_/_l_i_b_/_X_1_1_/_X_K_e_y_s_y_m_D_B,  where
  115.            <XRoot>    refers    to  the     root  of the X11 install
  116.            tree.  Note that if the same keysym  is    bound  to
  117.            multiple keys, the expression is executed for each
  118.            matching keycode.
  119.  
  120.        cclleeaarr _M_O_D_I_F_I_E_R_N_A_M_E
  121.            This removes all entries in the modifier     map  for
  122.            the  given  modifier, where valid name are: SShhiifftt,
  123.            LLoocckk, CCoonnttrrooll, MMoodd11, MMoodd22, MMoodd33,     MMoodd44,    and  MMoodd55
  124.            (case  does not matter in modifier names, although
  125.            it does matter for all other names).  For example,
  126.            ``clear    Lock'' will remove all any keys that were
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XMODMAP(1)                           XMODMAP(1)
  137.  
  138.  
  139.            bound to the shift lock modifier.
  140.  
  141.        aadddd _M_O_D_I_F_I_E_R_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
  142.            This adds all keys containing the given keysyms to
  143.            the  indicated modifier map.  The keysym names are
  144.            evaluated after all input expressions are read  to
  145.            make  it     easy  to  write expressions to swap keys
  146.            (see the EXAMPLES section).
  147.  
  148.        rreemmoovvee _M_O_D_I_F_I_E_R_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
  149.            This removes all keys containing the given keysyms
  150.            from  the indicated modifier map.  Unlike aadddd,, the
  151.            keysym names are evaluated as the line is read in.
  152.            This  allows  you  to  remove keys from a modifier
  153.            without having to worry about whether or not  they
  154.            have been reassigned.
  155.  
  156.        ppooiinntteerr == ddeeffaauulltt
  157.            This sets the pointer map back to its default set-
  158.            tings (button 1 generates a code of  1,    button    2
  159.            generates a 2, etc.).
  160.  
  161.        ppooiinntteerr == _N_U_M_B_E_R _._._.
  162.            This  sets to pointer map to contain the indicated
  163.            button codes.  The list    always    starts    with  the
  164.            first physical button.
  165.  
  166.        Lines  that  begin with an exclamation point (!) are taken
  167.        as comments.
  168.  
  169.        If you want to change the binding of a modifier    key,  you
  170.        must also remove it from the appropriate modifier map.
  171.  
  172. EEXXAAMMPPLLEESS
  173.        Many  pointers  are designed such that the first button is
  174.        pressed using the index finger of the right hand.   People
  175.        who  are     left-handed frequently find that it is more com-
  176.        fortable to reverse the button codes that get generated so
  177.        that  the primary button is pressed using the index finger
  178.        of the left hand.  This    could  be  done     on  a    3  button
  179.        pointer as follows:
  180.  
  181.         %  xmodmap -e "pointer = 3 2 1"
  182.  
  183.  
  184.        Many applications support the notion of Meta keys (similar
  185.        to Control keys except that Meta is held down  instead  of
  186.        Control).  However, some servers do not have a Meta keysym
  187.        in the default keymap table, so one needs to be    added  by
  188.        hand.   The  following  command    will  attach  Meta to the
  189.        Multi-language key (sometimes labeled Compose  Character).
  190.        It also takes advantage of the fact that applications that
  191.        need a Meta key simply need to get the keycode  and  don't
  192.        require the keysym to be in the first column of the keymap
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XMODMAP(1)                           XMODMAP(1)
  203.  
  204.  
  205.        table.  This means that applications that are looking  for
  206.        a  Multi_key  (including     the  default modifier map) won't
  207.        notice any change.
  208.  
  209.         %  xmodmap -e "keysym Multi_key = Multi_key Meta_L"
  210.  
  211.  
  212.        Similarly, some keyboards have an Alt key but no Meta key.
  213.        In that case the following may be useful:
  214.  
  215.         %  xmodmap -e "keysym Alt_L = Meta_L Alt_L"
  216.  
  217.  
  218.        One of the more simple, yet convenient, uses of _x_m_o_d_m_a_p is
  219.        to set the keyboard's "rubout" key to generate  an  alter-
  220.        nate   keysym.     This    frequently   involves  exchanging
  221.        Backspace with Delete to be more comfortable to the  user.
  222.        If the _t_t_y_M_o_d_e_s resource in _x_t_e_r_m is set as well, all ter-
  223.        minal emulator windows will use the same key  for  erasing
  224.        characters:
  225.  
  226.         %  xmodmap -e "keysym BackSpace = Delete"
  227.         %  echo "XTerm*ttyModes:  erase ^?" | xrdb -merge
  228.  
  229.  
  230.        Some keyboards do not automatically generate less than and
  231.        greater than characters when the comma and period keys are
  232.        shifted.      This    can be remedied with _x_m_o_d_m_a_p by resetting
  233.        the bindings for the comma and period with  the    following
  234.        scripts:
  235.  
  236.         !
  237.         ! make shift-, be < and shift-. be >
  238.         !
  239.         keysym comma = comma less
  240.         keysym period = period greater
  241.  
  242.  
  243.        One  of    the more irritating differences between keyboards
  244.        is the location of the Control and  Shift  Lock    keys.    A
  245.        common  use  of    _x_m_o_d_m_a_p is to swap these two keys as fol-
  246.        lows:
  247.  
  248.         !
  249.         ! Swap Caps_Lock and Control_L
  250.         !
  251.         remove Lock = Caps_Lock
  252.         remove Control = Control_L
  253.         keysym Control_L = Caps_Lock
  254.         keysym Caps_Lock = Control_L
  255.         add Lock = Caps_Lock
  256.         add Control = Control_L
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. XMODMAP(1)                           XMODMAP(1)
  269.  
  270.  
  271.        The _k_e_y_c_o_d_e command  is    useful    for  assigning    the  same
  272.        keysym to multiple keycodes.  Although unportable, it also
  273.        makes it possible to write scripts that can reset the key-
  274.        board  to  a  known  state.  The following script sets the
  275.        backspace key to generate Delete (as shown above), flushes
  276.        all existing caps lock bindings, makes the CapsLock key be
  277.        a  control  key,     make  F5  generate  Escape,  and   makes
  278.        Break/Reset be a shift lock.
  279.  
  280.         !
  281.         ! On the HP, the following keycodes have key caps as listed:
  282.         !
  283.         !      101  Backspace
  284.         !       55  Caps
  285.         !       14  Ctrl
  286.         !       15  Break/Reset
  287.         !       86  Stop
  288.         !       89  F5
  289.         !
  290.         keycode 101 = Delete
  291.         keycode 55 = Control_R
  292.         clear Lock
  293.         add Control = Control_R
  294.         keycode 89 = Escape
  295.         keycode 15 = Caps_Lock
  296.         add Lock = Caps_Lock
  297.  
  298.  
  299. EENNVVIIRROONNMMEENNTT
  300.        DDIISSPPLLAAYY to get default host and display number.
  301.  
  302. SSEEEE AALLSSOO
  303.        X(1), xev(1), _X_l_i_b documentation on key and pointer events
  304.  
  305. BBUUGGSS
  306.        Every time a kkeeyyccooddee expression is evaluated,  the  server
  307.        generates a _M_a_p_p_i_n_g_N_o_t_i_f_y event on every client.     This can
  308.        cause some  thrashing.    All  of     the  changes  should  be
  309.        batched    together  and done at once.  Clients that receive
  310.        keyboard input and ignore _M_a_p_p_i_n_g_N_o_t_i_f_y    events    will  not
  311.        notice any changes made to keyboard mappings.
  312.  
  313.        _X_m_o_d_m_a_p    should    generate  "add"     and "remove" expressions
  314.        automatically whenever a keycode that is already bound  to
  315.        a modifier is changed.
  316.  
  317.        There should be a way to have the _r_e_m_o_v_e expression accept
  318.        keycodes as well as  keysyms  for  those     times    when  you
  319.        really mess up your mappings.
  320.  
  321. AAUUTTHHOORR
  322.        Jim  Fulton,  MIT  X Consortium, rewritten from an earlier
  323.        version by David Rosenthal of Sun Microsystems.
  324.  
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. XMODMAP(1)                           XMODMAP(1)
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. X Version 11           Release 6.1                6
  395.  
  396.  
  397.