<simplesect id="config-keys_mouse-keychains" xreflabel="Keychains">
  <title>Keychains</title>

  <para>
    Pekwm also supports keychains. Keychain syntax follows the general
    config syntax and looks like this:
  </para>

  <screen>Chain = "modifiers and key" {
	Chain = "modifiers and key" {
		KeyPress = "modifiers and key" { Actions = "actions and their parameters" }
	}
	Keypress = "modifiers and key" { Actions = "actions and their parameters" }
}</screen>

  <para>
    It might seem complicated at start but once you look into it, it
    is fairly nice and logical. This syntax supports as many nested
    Chains as you might want.
  </para>

  <para>
    Now for some examples. Here we have a simple nested chain that
    lets you press Ctrl+Alt+M, then M, then M, V or H to toggle
    maximized attribute into Full/Vertical or Horizontal, and a
    simpler one level chain that brings up the root menu.
  </para>

  <screen>Chain = "Ctrl Mod1 A" {
	Chain = "M" {
		KeyPress = "M" { Actions = "Toggle Maximized True True" }
		KeyPress = "V" { Actions = "Toggle Maximized False True" }
		KeyPress = "H" { Actions = "Toggle Maximized True False" }
	}
}
Chain = "Ctrl Mod1 M" {
	KeyPress = "R" { Actions = "ShowMenu Root" }
}</screen>

  <para>
    This next rule is a pure show-off, it lets you type in 'test' and
    then executes xterm. Note that this will make you unable to type
    the character 't' to any programs.
  </para>

  <screen>Chain = "t" { Chain = "e" { Chain = "s" {
	Keypress = "t" { Actions = "Exec xterm" }
} } }</screen>

</simplesect>
