DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Configuring window manager key bindings

Creating a new key binding set

To create a new key binding set, perform the following steps.

  1. Open the desired window manager configuration file for editing.

  2. Locate the ``DefaultKeyBindings'' section in the window manager configuration file, copy it, then use it as a template for your new set.

  3. Configure the new key, function, and context specifications.

  4. Configure the new key binding set for use by the window manager with the keyBindings resource.

    Add this resource to /usr/lib/X11/app-defaults/Pmwm (for pmwm mode), /usr/lib/X11/app-defaults/Mwm (for mwm mode), or to the $HOME/.Xdefaults-hostname file, using the following syntax:

    Pmwm*keyBindings: bindings_set_name

    or

    Mwm*keyBindings: bindings_set_name

  5. Restart the window manager and test your new key binding set.

See also:

Step 1: Editing a window manager configuration file

If you want to make system-wide changes to the default key bindings, open the system-wide window manager configuration file, /usr/lib/X11/system.pmwmrc if you are using pmwm mode or system.mwmrc if you are using mwm mode. The system-wide file contains the default functionality for the window manager key bindings.

If you want to customize the key bindings in your local Graphical Environment, edit your personal window manager configuration file, $HOME/.pmwmrc if you are using pmwm mode or $HOME/.mwmrc if you are using mwm mode. The personal configuration file is not provided with the system by default. If it does not already exist, you must create your own by copying the appropriate system-wide window manager configuration file to .pmwmrc or .mwmrc in your $HOME directory.


NOTE: Once the .pmwmrc or .mwmrc file exists in $HOME, it completely overrides the system-wide window manager configuration file. Therefore, make sure you copy the entire system file to your home directory, to avoid losing critical functionality.

See also:

Step 2: Locating the DefaultKeyBindings section

When you locate the ``DefaultKeyBindings'' section, you see entries with the following syntax:

   Keys  DefaultKeyBindings	
   {
       keys  context     function
       keys  context     function
                .
                .
   }

Keys
the type of the binding set being defined

``DefaultKeyBindings''
the default name assigned to a set of bindings

keys
the specification that defines the key press action. See ``Modifiers'' for a list of modifiers that can be used with the key press actions.

context
the specification that defines the context in which the key specification becomes active. See ``Key binding contexts'' for a list and description of the values that can be used for context.

function
the specification that defines one of the many window manager functions or actions. See ``About window manager functions'' for a basic description of functions. See ``Using window manager functions'' for a list and a detailed description of window manager functions.
Create a template for your new binding set by copying the ``DefaultKeyBindings'' section and placing the copy below the existing section. Assign the new set a different name.

Step 3: Defining key, function, and context specifications

Each key binding definition consists of key event, function, and context specifications. Use the template you created in Step 2 to create these new specifications.

Step 4: Specifying the keyBindings resource

Define the name of the new key binding set through the keyBindings resource, using the appropriate resource file.

If you are making local changes, you must define the new binding set in the $HOME/.Xdefaults-hostname file. (If this file does yet not exist, create a file in your $HOME directory named .Xdefaults-hostname, where hostname is the name of the host, or machine, where the window manager is running.)

If you want the new key binding set to be used by all users on your system, specify the resource in /usr/lib/X11/app-default/Pmwm (if you are using pmwm mode) or /usr/lib/X11/app-default/Mwm (if you are using mwm mode).

The syntax of the resource specification is the same for all of the window manager configuration files:

Pmwm*keyBindings: new_key_bindings_set_name

or

Mwm*keyBindings: new_key_bindings_set_name

See also:


Step 5: Restarting the window manager

After you create your new key binding set, you must restart the window manager so your changes can take effect. Restart the window manager by selecting the Restart Window Manager option from the Root menu. The Root menu is accessed by pressing and holding mouse button 1 on the Desktop background or, if the Desktop is not running, in the Root window.

Verify that the new key binding set was created correctly by testing your new key sequences in the appropriate contexts. The key bindings are effective immediately after the window manager is restarted.


Next topic: Example of configuring key bindings
Previous topic: Step 6: Restarting the window manager

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003