In a manner similar to mouse button bindings, you can bind window
manager functions to keys on the keyboard using keyboard bindings.
Default Keyboard Bindings
OSF/Motif has default key bindings. These key bindings are
replaced with user-specified key bindings specified with the
keyBindings resource. The default key binding
specifications are listed below.
| Keys | Context | Function |
|---|---|---|
| Shift<Key>Escape | window|icon | f.post_wmenu |
| Alt<Key>space | window|icon | f.post_wmenu |
| Alt Shift<Key>Tab | root|icon|window | f.prev_key |
| Alt<Key>Escape | root|icon|window | f.circle_down |
| Alt Shift<Key>Escape | root|icon|window | f.circle_up |
| Alt Shift Ctrl<Key>! | root|icon|window | f.set_behavior |
| Alt Shift<Key>F6 | window | f.prev_key transient |
| Shift<Key>F10 | icon | f.post_wmenu |
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]
}
Each line identifies a unique key press sequence, followed by the
context in which that sequence is valid, followed by the function to
be done. Some functions require an argument. Context refers to the
location of the keyboard input focus when a key is pressed.
Modifying Keyboard Bindings
To modify the default keyboard bindings, you need to edit either
system.mwmrc to make system-wide changes or
.mwmrc to make changes to the local environment. The
easiest way to modify keyboard bindings is to change the default
bindings or to insert extra lines in the
DefaultKeyBindings.
When modifying a keyboard binding, you need to decide which key you want to bind and which action the key performs. Then choose the context in which the key binding is to work.
| Use this context | When the keyboard focus is here |
|---|---|
| root | Workspace (root window) |
| window | Client window (includes frame, title, border, and application window) |
| icon | Icon |
Note that if f.post_wmenu or f.menu is bound to a key, mwm automatically uses the same key for removing the menu from the screen after it has been popped up.
Suppose you wanted to eliminate a particular keyboard binding. To
disable it, you can delete or comment out the appropriate line in your
.mwmrc file. You comment out a line by placing an !
(exclamation point) comment character at the beginning of the
line. The following shows an example of a commented-out line in a
.mwmrc file:
Keys DefaultKeyBindings
{
!Shift<Key>Escape icon|window f.post_wmenu
Alt<Key>Tab window f.next_key
}
With keyboard bindings, as with button bindings, you have the
option of creating a whole new binding set. To do so, use the
DefaultKeyBindings of your .mwmrc file as a
model. After you have created the new keyboard binding set, use the
keyBindings resource to specify a key binding set in your
.Xdefaults file:
mwm*keyBindings: NewKeyboardBindingSetName
The default value for this resource is DefaultKeyBindings.