HPlogo Using the X Window System > Chapter 7 The Window Manager

Keyboard Bindings

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Similar to mouse button bindings, you can bind (associate) window manager functions to "special" keys on the keyboard using keyboard bindings. The window manager recognizes the following special keys:

  • Shift.

  • Escape.

  • Alt (Meta or Extend Char).

  • Tab.

  • Ctrl.

  • Lock.

Default Key Bindings

The OSF/Motif Window Manager comes with the following default key bindings.

Table 7-20 OSF/Motif Window Manager Default Keyboard Bindings

When the keyboard\focus is: Press: What this does is:
Window or icon ShiftEscapeDisplays window menu.
Window or icon AltspaceDisplays window menu.
Window, icon, or none AltTabSwitches keyboard focus to the next window or icon.
Window, icon, or none AltShiftTabSwitches keyboard focus to the previous window or icon.
Window, icon, or none AltEscapeSwitches keyboard focus to the next window or icon.
Window, icon, or none AltShiftEscapeSwitches keyboard focus to the previous window or icon.
WindowAltF6Switches keyboard focus to the next window or icon, including transient windows.
Window, icon, or none AltCtrlShift!Restart mwm with default or custom behavior.

 

These keyboard bindings are listed in the following lines in system.mwmrc and .mwmrc.

   Keys DefaultKeyBindings

   {

       Shift<Key>Escape          window             f.post_wmenu

       Alt<Key>space             window|icon        f.post_wmenu

       Alt<Key>Tab               root|icon|window   f.next_key

       Alt Shift<Key>Tab         root|icon|window   f.prev_key

       Alt<Key>Escape            root|icon|window   f.next_key

       Alt Shift<Key>Escape      root|icon|window   f.prev.key

       Alt<Key>F6                window             f.next_key transient

       Alt Ctrl Shift<Key>exclam root|icon|window   f.set_behavior

   }

You can modify or delete any of these bindings, except "Alt Ctrl Shift<Key>exclam", by editing or deleting the line. (In order for the editing to have an effect, the keyBindings resource in the .Xdefaults file must be set to DefaultKeyBindings.)

Modifying Keyboard Bindings and Their Functions

You can modify the keyboard bindings section of your .mwmrc file if your situation requires it.

Keyboard Binding Syntax

The syntax for keyboard bindings is as follows:

   Keys KeyBindingSetName

   {

      key   context|context  function  [argument]

      key   context|context  function  [argument]

      key   context|context  function  [argument]

   }

The following keyboard binding contexts are recognized by the window manager:

root

Operates the function when the key is pressed while the root window has keyboard focus.

window

Operates the function when the key is pressed while a client window has keyboard focus.

icon

Operates the function when the key is pressed while an icon has keyboard focus.

Modifying Keyboard Bindings

Key bindings can be modified by:

  • Editing the DefaultKeyBindings section in .mwmrc.

  • Making a new key binding set.

To create a new keyboard binding set:

  1. Edit .mwmrc to include the new key binding set with a unique name.

  2. Set the keyBindings resource in your .Xdefaults file to the new name.

© 1995 Hewlett-Packard Development Company, L.P.