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

Creating a new button binding set

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

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

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

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

  4. Configure the new button binding set for use by the window manager with the buttonBindings 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, where hostname is the name of the machine on which the window manager is running. Use the following syntax:

    Pmwm*buttonBindings: bindings_set_name

    or

    Mwm*buttonBindings: bindings_set_name

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

See also:


Step 1: Editing a window manager configuration file

If you want to make system-wide changes to the default button 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 button bindings.

If you want to customize the button 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 DefaultButtonBindings section

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

   Buttons  DefaultButtonBindings	
   {
       button  context     function
       button  context     function
                 .
                 .
   }

Buttons
the type of the binding set being defined

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

button
the specification that defines the mouse button action or the mouse button action plus a key sequence. See ``Button event definitions'' for a list of the values that can be used for button. See ``Modifiers'' for a list of modifiers that can be used with the button actions.

context
the specification that defines the context in which the button specification becomes active. See ``Button 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 functions.
Create a template for your new binding set by copying the ``DefaultButtonBindings'' section, placing the copy below the existing section. Assign the new set a different name.

Step 3: Defining button, function, and context specifications

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

Step 4: Specifying the buttonBindings resource

Define the new button binding set through the buttonBindings 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 button bindings 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*buttonBindings: new_button_bindings_set_name

or

Mwm*buttonBindings: new_button_bindings_set_name

See also:

Step 5: Restarting the window manager

After you create your new button 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 button binding set was created correctly by testing your new button sequences in the appropriate contexts. The button bindings are effective immediately after the window manager is restarted.


Next topic: Example of creating a new button set
Previous topic: Step 6: Restarting the window manager

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