home *** CD-ROM | disk | FTP | other *** search
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
- NNAAMMEE
- xmodmap - utility for modifying keymaps in X
-
- SSYYNNOOPPSSIISS
- xxmmooddmmaapp [-options ...] [filename]
-
- DDEESSCCRRIIPPTTIIOONN
- The _x_m_o_d_m_a_p program is used to edit and display the key-
- 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
- client applications to convert event keycodes into
- keysyms. It is usually run from the user's session
- startup script to configure the keyboard according to per-
- sonal tastes.
-
- OOPPTTIIOONNSS
- The following options may be used with _x_m_o_d_m_a_p:
-
- --ddiissppllaayy _d_i_s_p_l_a_y
- This option specifies the host and display to use.
-
- --hheellpp This option indicates that a brief description of
- the command line arguments should be printed on
- the standard error channel. This will be done
- whenever an unhandled argument is given to
- _x_m_o_d_m_a_p_.
-
- --ggrraammmmaarr
- This option indicates that a help message describ-
- ing the expression grammar used in files and with
- -e expressions should be printed on the standard
- error.
-
- --vveerrbboossee
- This option indicates that _x_m_o_d_m_a_p should print
- logging information as it parses its input.
-
- --qquuiieett This option turns off the verbose logging. This
- is the default.
-
- --nn This option indicates that _x_m_o_d_m_a_p should not
- change the mappings, but should display what it
- would do, like _m_a_k_e_(_1_) does when given this
- option.
-
- --ee _e_x_p_r_e_s_s_i_o_n
- This option specifies an expression to be exe-
- cuted. Any number of expressions may be specified
- from the command line.
-
- --ppmm This option indicates that the current modifier
- map should be printed on the standard output.
-
- --ppkk This option indicates that the current keymap
- table should be printed on the standard output.
-
-
-
- X Version 11 Release 6.1 1
-
-
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
- --ppkkee This option indicates that the current keymap
- table should be printed on the standard output in
- the form of expressions that can be fed back to
- _x_m_o_d_m_a_p.
-
- --pppp This option indicates that the current pointer map
- should be printed on the standard output.
-
- -- A lone dash means that the standard input should
- be used as the input file.
-
- The _f_i_l_e_n_a_m_e specifies a file containing _x_m_o_d_m_a_p expres-
- sions to be executed. This file is usually kept in the
- user's home directory with a name like _._x_m_o_d_m_a_p_r_c.
-
- EEXXPPRREESSSSIIOONN GGRRAAMMMMAARR
- The _x_m_o_d_m_a_p program reads a list of expressions and parses
- them all before attempting to execute any of them. This
- makes it possible to refer to keysyms that are being rede-
- fined in a natural way without having to worry as much
- about name conflicts.
-
- kkeeyyccooddee _N_U_M_B_E_R == _K_E_Y_S_Y_M_N_A_M_E _._._.
- The list of keysyms is assigned to the indicated
- keycode (which may be specified in decimal, hex or
- octal and can be determined by running the _x_e_v
- program.
-
- kkeeyyccooddee aannyy == _K_E_Y_S_Y_M_N_A_M_E _._._.
- If no existing key has the specified list of
- keysyms assigned to it, a spare key on the key-
- board is selected and the keysyms are assigned to
- it. The list of keysyms may be specified in deci-
- mal, hex or octal.
-
- kkeeyyssyymm _K_E_Y_S_Y_M_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
- The _K_E_Y_S_Y_M_N_A_M_E on the left hand side is translated
- into matching keycodes used to perform the corre-
- sponding set of kkeeyyccooddee expressions. The list of
- keysym names may be found in the header file
- _<_X_1_1_/_k_e_y_s_y_m_d_e_f_._h_> (without the _X_K__ prefix) or the
- keysym database _<_X_R_o_o_t_>_/_l_i_b_/_X_1_1_/_X_K_e_y_s_y_m_D_B, where
- <XRoot> refers to the root of the X11 install
- tree. Note that if the same keysym is bound to
- multiple keys, the expression is executed for each
- matching keycode.
-
- cclleeaarr _M_O_D_I_F_I_E_R_N_A_M_E
- This removes all entries in the modifier map for
- the given modifier, where valid name are: SShhiifftt,
- LLoocckk, CCoonnttrrooll, MMoodd11, MMoodd22, MMoodd33, MMoodd44, and MMoodd55
- (case does not matter in modifier names, although
- it does matter for all other names). For example,
- ``clear Lock'' will remove all any keys that were
-
-
-
- X Version 11 Release 6.1 2
-
-
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
- bound to the shift lock modifier.
-
- aadddd _M_O_D_I_F_I_E_R_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
- This adds all keys containing the given keysyms to
- the indicated modifier map. The keysym names are
- evaluated after all input expressions are read to
- make it easy to write expressions to swap keys
- (see the EXAMPLES section).
-
- rreemmoovvee _M_O_D_I_F_I_E_R_N_A_M_E == _K_E_Y_S_Y_M_N_A_M_E _._._.
- This removes all keys containing the given keysyms
- from the indicated modifier map. Unlike aadddd,, the
- keysym names are evaluated as the line is read in.
- This allows you to remove keys from a modifier
- without having to worry about whether or not they
- have been reassigned.
-
- ppooiinntteerr == ddeeffaauulltt
- This sets the pointer map back to its default set-
- tings (button 1 generates a code of 1, button 2
- generates a 2, etc.).
-
- ppooiinntteerr == _N_U_M_B_E_R _._._.
- This sets to pointer map to contain the indicated
- button codes. The list always starts with the
- first physical button.
-
- Lines that begin with an exclamation point (!) are taken
- as comments.
-
- If you want to change the binding of a modifier key, you
- must also remove it from the appropriate modifier map.
-
- EEXXAAMMPPLLEESS
- Many pointers are designed such that the first button is
- pressed using the index finger of the right hand. People
- who are left-handed frequently find that it is more com-
- fortable to reverse the button codes that get generated so
- that the primary button is pressed using the index finger
- of the left hand. This could be done on a 3 button
- pointer as follows:
-
- % xmodmap -e "pointer = 3 2 1"
-
-
- Many applications support the notion of Meta keys (similar
- to Control keys except that Meta is held down instead of
- Control). However, some servers do not have a Meta keysym
- in the default keymap table, so one needs to be added by
- hand. The following command will attach Meta to the
- Multi-language key (sometimes labeled Compose Character).
- It also takes advantage of the fact that applications that
- need a Meta key simply need to get the keycode and don't
- require the keysym to be in the first column of the keymap
-
-
-
- X Version 11 Release 6.1 3
-
-
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
- table. This means that applications that are looking for
- a Multi_key (including the default modifier map) won't
- notice any change.
-
- % xmodmap -e "keysym Multi_key = Multi_key Meta_L"
-
-
- Similarly, some keyboards have an Alt key but no Meta key.
- In that case the following may be useful:
-
- % xmodmap -e "keysym Alt_L = Meta_L Alt_L"
-
-
- One of the more simple, yet convenient, uses of _x_m_o_d_m_a_p is
- to set the keyboard's "rubout" key to generate an alter-
- nate keysym. This frequently involves exchanging
- Backspace with Delete to be more comfortable to the user.
- If the _t_t_y_M_o_d_e_s resource in _x_t_e_r_m is set as well, all ter-
- minal emulator windows will use the same key for erasing
- characters:
-
- % xmodmap -e "keysym BackSpace = Delete"
- % echo "XTerm*ttyModes: erase ^?" | xrdb -merge
-
-
- Some keyboards do not automatically generate less than and
- greater than characters when the comma and period keys are
- shifted. This can be remedied with _x_m_o_d_m_a_p by resetting
- the bindings for the comma and period with the following
- scripts:
-
- !
- ! make shift-, be < and shift-. be >
- !
- keysym comma = comma less
- keysym period = period greater
-
-
- One of the more irritating differences between keyboards
- is the location of the Control and Shift Lock keys. A
- common use of _x_m_o_d_m_a_p is to swap these two keys as fol-
- lows:
-
- !
- ! Swap Caps_Lock and Control_L
- !
- remove Lock = Caps_Lock
- remove Control = Control_L
- keysym Control_L = Caps_Lock
- keysym Caps_Lock = Control_L
- add Lock = Caps_Lock
- add Control = Control_L
-
-
-
-
-
- X Version 11 Release 6.1 4
-
-
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
- The _k_e_y_c_o_d_e command is useful for assigning the same
- keysym to multiple keycodes. Although unportable, it also
- makes it possible to write scripts that can reset the key-
- board to a known state. The following script sets the
- backspace key to generate Delete (as shown above), flushes
- all existing caps lock bindings, makes the CapsLock key be
- a control key, make F5 generate Escape, and makes
- Break/Reset be a shift lock.
-
- !
- ! On the HP, the following keycodes have key caps as listed:
- !
- ! 101 Backspace
- ! 55 Caps
- ! 14 Ctrl
- ! 15 Break/Reset
- ! 86 Stop
- ! 89 F5
- !
- keycode 101 = Delete
- keycode 55 = Control_R
- clear Lock
- add Control = Control_R
- keycode 89 = Escape
- keycode 15 = Caps_Lock
- add Lock = Caps_Lock
-
-
- EENNVVIIRROONNMMEENNTT
- DDIISSPPLLAAYY to get default host and display number.
-
- SSEEEE AALLSSOO
- X(1), xev(1), _X_l_i_b documentation on key and pointer events
-
- BBUUGGSS
- Every time a kkeeyyccooddee expression is evaluated, the server
- generates a _M_a_p_p_i_n_g_N_o_t_i_f_y event on every client. This can
- cause some thrashing. All of the changes should be
- batched together and done at once. Clients that receive
- keyboard input and ignore _M_a_p_p_i_n_g_N_o_t_i_f_y events will not
- notice any changes made to keyboard mappings.
-
- _X_m_o_d_m_a_p should generate "add" and "remove" expressions
- automatically whenever a keycode that is already bound to
- a modifier is changed.
-
- There should be a way to have the _r_e_m_o_v_e expression accept
- keycodes as well as keysyms for those times when you
- really mess up your mappings.
-
- AAUUTTHHOORR
- Jim Fulton, MIT X Consortium, rewritten from an earlier
- version by David Rosenthal of Sun Microsystems.
-
-
-
-
- X Version 11 Release 6.1 5
-
-
-
-
-
- XMODMAP(1) XMODMAP(1)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- X Version 11 Release 6.1 6
-
-
-