diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-08-21 12:04:10 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-18 21:04:27 (GMT) |
commit | 9e93ff6c5303a3d53a55df02461f3f81796729dd (patch) | |
tree | 8e7158b2905ca768f6443006ef463a4d6bb7eb47 /doc | |
parent | 9a3ebdb4c94c2a78ac26feddd23c12cc81c89434 (diff) | |
download | fluxbox_pavel-9e93ff6c5303a3d53a55df02461f3f81796729dd.zip fluxbox_pavel-9e93ff6c5303a3d53a55df02461f3f81796729dd.tar.bz2 |
Documentation: update fluxbox-keys for lua
Diffstat (limited to 'doc')
-rw-r--r-- | doc/asciidoc/fluxbox-keys.txt | 89 |
1 files changed, 50 insertions, 39 deletions
diff --git a/doc/asciidoc/fluxbox-keys.txt b/doc/asciidoc/fluxbox-keys.txt index a26af34..f98c40d 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 | ||
21 | Optional parameters are shown in square brackets: ['argument'] | 21 | Optional parameters are shown in square brackets: ['argument'] |
22 | 22 | ||
23 | All other characters shown are required verbatim. Whitespace is required | 23 | Other characters shown are required verbatim. Exceptions to these rules are |
24 | where shown, but it is fine to add more whitespace. | 24 | mentioned when appropriate. |
25 | 25 | ||
26 | DESCRIPTION | 26 | DESCRIPTION |
27 | ----------- | 27 | ----------- |
28 | The keys file defines the keyboard shortcuts for 'fluxbox(1)'. | 28 | The keys file defines the keyboard shortcuts for 'fluxbox(1)'. |
29 | 29 | ||
30 | You can customize fluxbox's key handling through the ~/.fluxbox/keys file. The | 30 | You can customize fluxbox's key handling through the ~/.fluxbox/keys file. The |
31 | file consists of lines of the basic format: | 31 | file consists of entries of the basic format (the outer set of square brackets |
32 | is verbatim): | ||
32 | 33 | ||
33 | *['modifiers'] 'key' :'command' ['arguments' '...']* | 34 | 'keymode'*["*['modifiers'] 'key'*"]* = 'action' |
34 | 35 | ||
35 | The space between the 'key' and the *:* before the 'command' is mandatory. | 36 | For description of 'keymode' see the KEYMODES section. |
36 | 37 | ||
37 | All modifiers and commands are case-insensitive. Some command arguments | 38 | The 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 | 39 | is bound. It consists of key names optionally preceded by modifiers. Keys and |
40 | modifiers are separated by spaces. Modifiers are case-insensitive, while some | ||
39 | key names are case-sensitive. | 41 | key names are case-sensitive. |
40 | 42 | ||
41 | Lines 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. |
42 | fluxbox. | 44 | Lua 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. | ||
46 | Fluxbox commands are described in the COMMANDS section. | ||
43 | 47 | ||
44 | You will need to ``reload'' fluxbox after editing the keys file so it picks up | 48 | To remove a binding for a specific key combination use *nil* as 'action'. To |
45 | your change. | 49 | remove all keybindings from a keymode, use the syntax: |
50 | |||
51 | 'keymode'*:clear()* | ||
52 | |||
53 | Standard lua comments are used: everything from *--* to the end of the line is | ||
54 | ignored. Block comments are enclosed in *--[[* and *]]*. | ||
55 | |||
56 | Changes to this file are automatically picked up by fluxbox so there is no need | ||
57 | to restart or reconfigure. Fluxbox will never overwrite this file. | ||
46 | 58 | ||
47 | MODIFIERS | 59 | MODIFIERS |
48 | --------- | 60 | --------- |
@@ -127,28 +139,37 @@ CHAINING | |||
127 | Key bindings can be chained in a fashion similar to Emacs key bindings using the | 139 | Key bindings can be chained in a fashion similar to Emacs key bindings using the |
128 | syntax: | 140 | syntax: |
129 | 141 | ||
130 | 'modifiers-1' 'key-1' 'modifiers-2' 'key-2' :'command' ['arguments ...']* | 142 | 'keymode'*["*['modifiers-1'] 'key-1' ['modifiers-2'] 'key-2'... *"]* = 'action' |
131 | 143 | ||
132 | To abort a chained command part-way through typing it, press the <ESC> key. | 144 | To abort a chained command part-way through typing it, press the <ESC> key. |
133 | 145 | ||
134 | .To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox | 146 | .To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox |
135 | ........ | 147 | ........ |
136 | Control c Control x :Quit | 148 | default_keymode["Control c Control x"] = "Quit" |
137 | ........ | 149 | ........ |
138 | 150 | ||
139 | KEYMODES | 151 | KEYMODES |
140 | -------- | 152 | -------- |
141 | A specific set of key mappings can be activated and de-activated on-the-fly | 153 | A specific set of key mappings can be activated and de-activated on-the-fly |
142 | using what are called keymodes. The syntax to define a mapping in a keymode | 154 | using what are called keymodes. Fluxbox provides a default keymode called |
143 | is: | 155 | *default_keymode*. To create a new keymode use the syntax: |
156 | |||
157 | 'keymode' *= newKeymode()* | ||
144 | 158 | ||
145 | *'keymode': 'modifiers' 'key' :'command' ['arguments' '...']* | 159 | Where 'keymode' is any legal lua variable name. If you want to activate this |
160 | keymode when a certain key combination is pressed, use the syntax: | ||
146 | 161 | ||
147 | Where 'keymode' is any alpha-numeric string name. | 162 | 'other_keymode'*["*'key combination'*"] = function()* 'keymode'*:activate() end* |
148 | 163 | ||
149 | When this keymode is activated (see the *KeyMode* command below), all bindings | 164 | When this keymode is activated, all bindings |
150 | prefaced by that keymode name become active (and all other keybindings will be | 165 | prefaced by that keymode name become active (and all other keybindings will be |
151 | deactivated) until the keymode changes again. | 166 | deactivated) until the keymode changes again. Do not forget to add a binding |
167 | which will reactivate the old keymode if you want to be able to return to it. | ||
168 | |||
169 | If you do not want to type *default_keymode* for every binding, you can create | ||
170 | an alias for it using the syntax: | ||
171 | |||
172 | 'x' *= default_keymode* | ||
152 | 173 | ||
153 | COMMANDS | 174 | COMMANDS |
154 | -------- | 175 | -------- |
@@ -558,16 +579,6 @@ These commands have special meanings or behaviors. | |||
558 | Alternates between the commands. On the first press of the bound | 579 | Alternates between the commands. On the first press of the bound |
559 | key, runs 'command1'. On the next press, runs 'command2'. | 580 | key, runs 'command1'. On the next press, runs 'command2'. |
560 | 581 | ||
561 | *BindKey* 'keybinding':: | ||
562 | Adds the given 'keybinding' (which must be a valid key binding as | ||
563 | defined in the DESCRIPTION section above) to your keys file. | ||
564 | |||
565 | *KeyMode* 'keymode' ['return-keybinding']:: | ||
566 | Activates the named 'keymode' (or, all key binding lines prefaced | ||
567 | with the same 'keymode':) and deactivates all others until the | ||
568 | 'return-keybinding' (by default *Escape*) is pressed. The default | ||
569 | keymode is named 'default'. | ||
570 | |||
571 | *ForEach* {'command'} [{'condition'}] | *Map* {'command'} [{'condition'}]:: | 582 | *ForEach* {'command'} [{'condition'}] | *Map* {'command'} [{'condition'}]:: |
572 | Runs the given 'command' (normally one from the *Window Commands* | 583 | Runs the given 'command' (normally one from the *Window Commands* |
573 | section above) on each window. If you specify a 'condition' (See | 584 | section above) on each window. If you specify a 'condition' (See |
@@ -625,7 +636,7 @@ include::client-patterns.txt[] | |||
625 | 636 | ||
626 | FILES | 637 | FILES |
627 | ----- | 638 | ----- |
628 | *~/.fluxbox/keys*:: | 639 | *~/.fluxbox/keys.lua*:: |
629 | This is the default location for the keybinding definitions. | 640 | This is the default location for the keybinding definitions. |
630 | */usr/X11R6/include/X11/keysymdef.h*:: | 641 | */usr/X11R6/include/X11/keysymdef.h*:: |
631 | X key names are in this file. | 642 | X key names are in this file. |
@@ -655,18 +666,18 @@ Here are some interesting and/or useful examples you can do with your keys | |||
655 | file. | 666 | file. |
656 | 667 | ||
657 | .................. | 668 | .................. |
658 | # Mod4+drag moves a window | 669 | -- Mod4+drag moves a window |
659 | OnWindow Mod4 Mouse1 :StartMoving | 670 | default_keymode["OnWindow Mod4 Mouse1"] = "StartMoving" |
660 | 671 | ||
661 | # If any xterm windows are open, cycle through them. If none are open, open | 672 | -- If any xterm windows are open, cycle through them. If none are open, open |
662 | # one: | 673 | -- one: |
663 | Mod4 t :If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm} | 674 | default_keymode["Mod4 t"] = "If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm}" |
664 | 675 | ||
665 | # Set a different wallpaper on every workspace: | 676 | -- Set a different wallpaper on every workspace: |
666 | ChangeWorkspace :Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png | 677 | default_keymode["ChangeWorkspace"] = "Exec fbsetbg ~/.fluxbox/bg$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}').png" |
667 | 678 | ||
668 | # Focusses the next window with it's xproperty 'PROP' set to 'foo' | 679 | -- Focusses the next window with it's xproperty 'PROP' set to 'foo' |
669 | Mod4 p Mod4 Tab :NextWindow (@PROP=foo) | 680 | default_keymode["Mod4 p Mod4 Tab"] = "NextWindow (@PROP=foo)" |
670 | .................. | 681 | .................. |
671 | 682 | ||
672 | 683 | ||