Help:Bindings

From Openbox

(Difference between revisions)
Jump to: navigation, search
m (Key bindings)
(Actions)
Line 62: Line 62:
 
=== Actions ===
 
=== Actions ===
 
The '''ACTIONS''' can be any number of [[#Actions| actions]].  They will generally be executed in order from the first to the last.
 
The '''ACTIONS''' can be any number of [[#Actions| actions]].  They will generally be executed in order from the first to the last.
 +
 +
== Key chains ==
 +
You can create Emacs-style key chains simply by nesting key bindings inside each other.  Here's an example"
 +
<code><pre>
 +
  <keybind key="C-f">
 +
    <keybind key="x">
 +
      <action name="ToggleMaximizeFull"/>
 +
    </keybind>
 +
  </keybind>
 +
</pre></code>
 +
 +
In order to maximize the window using this key binding you would press the Control key and the "f" key together (which is written as C-f), then you would release everything and press the "x" key.

Revision as of 19:52, 3 June 2007

Key and mouse bindings are created in your ~/.config/openbox/rc.xml file. You should copy the file from /etc/xdg/openbox/rc.xml to ~/.config/openbox/rc.xml to edit it, if that file does not already exist.

Key bindings and mouse bindings both use Actions to specify what they will do. There are a lot of actions available to you. First we'll talk about how to write a generic key binding, or mouse binding. Then we'll discuss all the actions that are available.

Contents

Key bindings

Key bindings are found in the <keyboard> section of your rc.xml configuration file. Any bindings outside of that section are not valid and will be ignored.

Here's a few example key bindings from the default configuration file:

<keyboard>
  <keybind key="A-F4">
    <action name="Close"/>
  </keybind>
  <keybind key="A-Escape">
    <action name="Lower"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
  </keybind>
  <keybind key="A-space">
    <action name="ShowMenu"><menu>client-menu</menu></action>
  </keybind>
</keyboard>

Syntax

A key binding is specified as follows:

<keyboard>
  ...
  <keybind key="KEY-COMBO">
    ...ACTIONS...
  </keybind>
  ...
</keyboard>

Key combinations

KEY-COMBO is the key combination which you want to bind to the actions. The format for the KEY-COMBO is: Modifier-Modifier-Key. Any number of modifiers (0 or more) can be used together, and they are each separated by a "-".

Modifier keys
S Shift key
C Control key
A Alt key
W Super key (Usually bound to the Windows key on keyboards which have one)
H Hyper key (If it is bound to something)

The Key is the name of the key, such as "a", "space", "Escape", or "F1". You can find the name of any key by using the xev command in a terminal, pressing the desired key, and watching the output from xev in the terminal.

Actions

The ACTIONS can be any number of actions. They will generally be executed in order from the first to the last.

Key chains

You can create Emacs-style key chains simply by nesting key bindings inside each other. Here's an example"

  <keybind key="C-f">
    <keybind key="x">
      <action name="ToggleMaximizeFull"/>
    </keybind>
  </keybind>

In order to maximize the window using this key binding you would press the Control key and the "f" key together (which is written as C-f), then you would release everything and press the "x" key.

Personal tools