Example of configuring key bindings
This section provides a comprehensive example that ties
together some of the concepts and procedures discussed
in this chapter.
The following example assumes that you are using
the default pmwm mode of the window manager,
that you want to create
a new key binding set for your local environment, and
you want to name the set ``MyKeyBindings''.
MyKeyBindings consists of
four key binding definitions that produce the following results:
-
Pressing <Shift><Esc> with the keyboard input focus
on either an icon or window posts the menu named for the
Pmwm*windowMenu resource specification.
(See line 6 of the following sample file.)
-
Pressing <Ctrl><Space> with the keyboard input focus
on either an icon or window, or on the Root menu,
posts the menu named ``MyRootMenu''. (See line 7
of the following sample file.)
-
Pressing <Alt><Esc> with the keyboard input focus
on either an icon or window, or on the Root menu, sets
the keyboard input focus to the next icon or window in the
set of icons or windows managed by the window manager.
(See line 8 of the following sample file.)
-
Pressing <Alt> <Shift><Esc> with the keyboard input
focus on either an icon or window, or on the Root menu,
sets the keyboard input focus
to the previous icon or window in the set of
icons or windows managed by the window manager.
(See line 9 of the following sample file.)
To create this new set:
-
Open the .pmwmrc file in your $HOME directory
for editing.
(If .pmwmrc does not already exist, create it by copying
/usr/lib/X11/system.pmwmrc to .pmwmrc in
your $HOME directory.)
-
Locate the ``DefaultKeyBindings''
section in the .pmwmrc
file and place a copy of the section underneath the
default definitions. You can use this copy as a template
for your new key binding set.
-
Rename ``DefaultKeyBindings'' to ``MyKeyBindings''.
-
Edit the template so that it looks like this:
1 #
2 # key binding descriptions
3 #
4 Keys MyKeyBindings
5 {
6 Shift<Key>Escape icon|window f.post_wmenu
7 Ctrl<Key>space icon|window|root f.menu MyRootMenu
8 Alt<Key>Escape icon|window|root f.next_key
9 Alt Shift<Key>Escape icon|window|root f.prev_key
10 }
-
Define the keyBindings resource to announce the
new key binding set to the window manager.
Specify the resource in the
$HOME/.Xdefaults-hostname file,
where hostname
is the name of the host, or machine, where the
window manager is running. The resource specification
should look like this:
PmwmkeyBindings: MyKeyBindings
-
Restart the window manager so that the new key binding
information is implemented.
Previous topic:
Step 5: Restarting the window manager
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005