aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/asciidoc/fluxbox-keys.txt89
1 files changed, 50 insertions, 39 deletions
diff --git a/doc/asciidoc/fluxbox-keys.txt b/doc/asciidoc/fluxbox-keys.txt
index 0d0b52e..5ae4bec 100644
--- a/doc/asciidoc/fluxbox-keys.txt
+++ b/doc/asciidoc/fluxbox-keys.txt
@@ -20,29 +20,41 @@ Variable parameters are shown in emphasis: 'argument'
20 20
21Optional parameters are shown in square brackets: ['argument'] 21Optional parameters are shown in square brackets: ['argument']
22 22
23All other characters shown are required verbatim. Whitespace is required 23Other characters shown are required verbatim. Exceptions to these rules are
24where shown, but it is fine to add more whitespace. 24mentioned when appropriate.
25 25
26DESCRIPTION 26DESCRIPTION
27----------- 27-----------
28The keys file defines the keyboard shortcuts for 'fluxbox(1)'. 28The keys file defines the keyboard shortcuts for 'fluxbox(1)'.
29 29
30You can customize fluxbox's key handling through the ~/.fluxbox/keys file. The 30You can customize fluxbox's key handling through the ~/.fluxbox/keys file. The
31file consists of lines of the basic format: 31file consists of entries of the basic format (the outer set of square brackets
32is verbatim):
32 33
33*['modifiers'] 'key' :'command' ['arguments' '...']* 34'keymode'*["*['modifiers'] 'key'*"]* = 'action'
34 35
35The space between the 'key' and the *:* before the 'command' is mandatory. 36For description of 'keymode' see the KEYMODES section.
36 37
37All modifiers and commands are case-insensitive. Some command arguments 38The string in square brackets specifies the key combination to which an action
38(especially those that will be passed to the shell) are case-sensitive. Some 39is bound. It consists of key names optionally preceded by modifiers. Keys and
40modifiers are separated by spaces. Modifiers are case-insensitive, while some
39key names are case-sensitive. 41key names are case-sensitive.
40 42
41Lines beginning with a '#' or '!' are considered comments and are unread by 43'action' can either be a lua funcion or a string representing a fluxbox command.
42fluxbox. 44Lua functions can for example be used to change values of fluxbox resources (see
45*fluxbox(1)* for a description of resources) or to add further keybindings.
46Fluxbox commands are described in the COMMANDS section.
43 47
44You will need to ``reload'' fluxbox after editing the keys file so it picks up 48To remove a binding for a specific key combination use *nil* as 'action'. To
45your change. 49remove all keybindings from a keymode, use the syntax:
50
51'keymode'*:clear()*
52
53Standard lua comments are used: everything from *--* to the end of the line is
54ignored. Block comments are enclosed in *--[[* and *]]*.
55
56Changes to this file are automatically picked up by fluxbox so there is no need
57to restart or reconfigure. Fluxbox will never overwrite this file.
46 58
47MODIFIERS 59MODIFIERS
48--------- 60---------
@@ -125,28 +137,37 @@ CHAINING
125Key bindings can be chained in a fashion similar to Emacs key bindings using the 137Key bindings can be chained in a fashion similar to Emacs key bindings using the
126syntax: 138syntax:
127 139
128'modifiers-1' 'key-1' 'modifiers-2' 'key-2' :'command' ['arguments ...']* 140'keymode'*["*['modifiers-1'] 'key-1' ['modifiers-2'] 'key-2'... *"]* = 'action'
129 141
130To abort a chained command part-way through typing it, press the <ESC> key. 142To abort a chained command part-way through typing it, press the <ESC> key.
131 143
132.To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox 144.To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox
133........ 145........
134Control c Control x :Quit 146default_keymode["Control c Control x"] = "Quit"
135........ 147........
136 148
137KEYMODES 149KEYMODES
138-------- 150--------
139A specific set of key mappings can be activated and de-activated on-the-fly 151A specific set of key mappings can be activated and de-activated on-the-fly
140using what are called keymodes. The syntax to define a mapping in a keymode 152using what are called keymodes. Fluxbox provides a default keymode called
141is: 153*default_keymode*. To create a new keymode use the syntax:
154
155'keymode' *= newKeymode()*
142 156
143*'keymode': 'modifiers' 'key' :'command' ['arguments' '...']* 157Where 'keymode' is any legal lua variable name. If you want to activate this
158keymode when a certain key combination is pressed, use the syntax:
144 159
145Where 'keymode' is any alpha-numeric string name. 160'other_keymode'*["*'key combination'*"] = function()* 'keymode'*:activate() end*
146 161
147When this keymode is activated (see the *KeyMode* command below), all bindings 162When this keymode is activated, all bindings
148prefaced by that keymode name become active (and all other keybindings will be 163prefaced by that keymode name become active (and all other keybindings will be
149deactivated) until the keymode changes again. 164deactivated) until the keymode changes again. Do not forget to add a binding
165which will reactivate the old keymode if you want to be able to return to it.
166
167If you do not want to type *default_keymode* for every binding, you can create
168an alias for it using the syntax:
169
170'x' *= default_keymode*
150 171
151COMMANDS 172COMMANDS
152-------- 173--------
@@ -548,16 +569,6 @@ These commands have special meanings or behaviors.
548 Alternates between the commands. On the first press of the bound 569 Alternates between the commands. On the first press of the bound
549 key, runs 'command1'. On the next press, runs 'command2'. 570 key, runs 'command1'. On the next press, runs 'command2'.
550 571
551*BindKey* 'keybinding'::
552 Adds the given 'keybinding' (which must be a valid key binding as
553 defined in the DESCRIPTION section above) to your keys file.
554
555*KeyMode* 'keymode' ['return-keybinding']::
556 Activates the named 'keymode' (or, all key binding lines prefaced
557 with the same 'keymode':) and deactivates all others until the
558 'return-keybinding' (by default *Escape*) is pressed. The default
559 keymode is named 'default'.
560
561*ForEach* {'command'} [{'condition'}] | *Map* {'command'} [{'condition'}]:: 572*ForEach* {'command'} [{'condition'}] | *Map* {'command'} [{'condition'}]::
562 Runs the given 'command' (normally one from the *Window Commands* 573 Runs the given 'command' (normally one from the *Window Commands*
563 section above) on each window. If you specify a 'condition' (See 574 section above) on each window. If you specify a 'condition' (See
@@ -615,7 +626,7 @@ include::client-patterns.txt[]
615 626
616FILES 627FILES
617----- 628-----
618*~/.fluxbox/keys*:: 629*~/.fluxbox/keys.lua*::
619 This is the default location for the keybinding definitions. 630 This is the default location for the keybinding definitions.
620*/usr/X11R6/include/X11/keysymdef.h*:: 631*/usr/X11R6/include/X11/keysymdef.h*::
621 X key names are in this file. 632 X key names are in this file.
@@ -645,18 +656,18 @@ Here are some interesting and/or useful examples you can do with your keys
645file. 656file.
646 657
647.................. 658..................
648# Mod4+drag moves a window 659-- Mod4+drag moves a window
649OnWindow Mod4 Mouse1 :StartMoving 660default_keymode["OnWindow Mod4 Mouse1"] = "StartMoving"
650 661
651# If any xterm windows are open, cycle through them. If none are open, open 662-- If any xterm windows are open, cycle through them. If none are open, open
652# one: 663-- one:
653Mod4 t :If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm} 664default_keymode["Mod4 t"] = "If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm}"
654 665
655# Set a different wallpaper on every workspace: 666-- Set a different wallpaper on every workspace:
656ChangeWorkspace :Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png 667default_keymode["ChangeWorkspace"] = "Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png"
657 668
658# Focusses the next window with it's xproperty 'PROP' set to 'foo' 669-- Focusses the next window with it's xproperty 'PROP' set to 'foo'
659Mod4 p Mod4 Tab :NextWindow (@PROP=foo) 670default_keymode["Mod4 p Mod4 Tab"] = "NextWindow (@PROP=foo)"
660.................. 671..................
661 672
662 673