The space between the \fIkey\fR and the \fB:\fR before the \fIcommand\fR is mandatory\.
.sp
All modifiers and commands are case\-insensitive\. Some command arguments (especially those that will be passed to the shell) are case\-sensitive\. Some key names are case\-sensitive\.
.sp
Lines beginning with a \fI#\fR or \fI!\fR are considered comments and are unread by fluxbox\.
.sp
.SH"MODIFIERS"
You can get a list of possible modifiers by calling `xmodmap \-pm\'\. This also shows you to which keys the modifiers are mapped, but the following modifiers are most commonly used:
.sp
\fBShift Control Mod1 Mod4\fR
.sp
where \fBMod1\fR is the Alt key on the PC keyboard and \fBMod4\fR is usually a key branded with a familiar company logo\.
.PP
There are also some special modifiers that refer to mouse button presses:
.RS4
.PP
\fBOnDesktop\fR
.RS4
The mouse cursor is over the desktop (root window), and not any window\.
.RE
.PP
\fBOnToolbar\fR
.RS4
The mouse cursor is over the toolbar (which is normally at the bottom of the screen)\.
.RE
.PP
\fBOnWindow\fR
.RS4
The mouse cursor is over a window\.
.RE
.PP
\fBOnTitlebar\fR
.RS4
The mouse cursor is over a window\'s titlebar\.
.RE
.PP
\fBDouble\fR
.RS4
Limits this action to double\-clicks only\.
.RE
.RE
.SS"Combining Modifiers"
To combine two or more modifiers, just list them (space\-delimited) in any order\.
.sp
.SH"KEYS"
You may specify a key by its key name (for example, \fBa\fR or \fBspace\fR) or by its numeric keycode (for example, \fB38\fR or \fB0xf3\fR)\.
.sp
If you don\'t know the name of a key, you can run \fIxev(1)\fR in a terminal, push the key, and see the name in the output\. If you have some "special" keys that do not produce a key name in the output of \fIxev(1)\fR, you can just use the keycode (NOT the keysym!) in your keys file\.
.sp
Commands can also be bound to mouse button presses, for which the proper "key" name is \fBMouse\fR\fIn\fR where \fIn\fR is the number of the mouse button\. For example, \fBMouse1\fR is the primary button, and \fBMouse4\fR / \fBMouse5\fR are the scroll wheel events, in normal configurations\.\fIxev(1)\fR can also be used to tell the button number\.
.sp
.SH"CHAINING"
Key bindings can be chained in a fashion similar to Emacs key bindings using the syntax:
\fBExample\ 1.\ To Bind CTRL+C CTRL+X (Which means, press CTRL+C then CTRL+X) to quit fluxbox\fR
.sp
.RS4
.nf
Control c Control x :Quit
.fi
.RE
.SH"KEYMODES"
A specific set of key mappings can be activated and de\-activated on\-the\-fly using what are called keymodes\. The syntax to define a mapping in a keymode is:
Where \fIkeymode\fR is any alpha\-numeric string name\.
.sp
When this keymode is activated (see the \fBKeyMode\fR command below), all bindings prefaced by that keymode name become active (and all other keybindings will be deactivated) until the keymode changes again\.
.sp
.SH"COMMANDS"
.PP
Some commands have multiple names which are shown below as:
.RS4
CMD1 | CMD2
.RE
.PP
Related commands have been grouped below as:
.RS4
CMD1 / CMD2
.RE
.PP
The commands are broken up into sections as follows:
.RS4
.sp
.RS4
\h'-04'\(bu\h'+03'Mouse Commands
.RE
.sp
.RS4
\h'-04'\(bu\h'+03'Window Commands
.RE
.sp
.RS4
\h'-04'\(bu\h'+03'Workspace Commands
.RE
.sp
.RS4
\h'-04'\(bu\h'+03'Menu Commands
.RE
.sp
.RS4
\h'-04'\(bu\h'+03'Window Manager Commands
.RE
.sp
.RS4
\h'-04'\(bu\h'+03'Special Commands
.RE
.RE
.SS"Mouse Commands"
These commands may only be bound to mouse buttons (plus modifiers), not keystrokes\. In all cases, the action finishes when the mouse button is released\.
.PP
\fBStartMoving\fR
.RS4
Start dragging to move the window\.
.RE
.PP
\fBStartResizing\fR [\fIcorner\fR]
.RS4
Start dragging to resize the window as if you had grabbed the window at the specified
\fIcorner\fR\.
.PP
By default \fIcorner\fR is \fBBottomRight\fR, but may be overridden with one of:
.RS4
\fBNearestCorner NearestEdge Center TopLeft Top TopRight Left Right BottomLeft BottomRight\fR
.RE
.RE
.PP
\fBStartTabbing\fR
.RS4
Start dragging to add this window to another\'s tabgroup\.
These commands ordinarily affect only the currently focused window\. The \fBOnWindow\fR modifier and \fBForEach\fR command may affect the window that is used\.
Sends you along with the current window to the next or previous workspace\. If you set
\fIoffset\fR
to a value greater than the default of
\fB1\fR, it will move you that number of workspaces ahead or behind\. If you go beyond the end of the currently defined workspaces, it will wrap around to the other end automatically\.
Switch to the Next / Previous workspace\. All versions accept an offset value
\fIn\fR, which defaults to
\fB1\fR
and refers to the number of workspaces to move at one time\. {Next,Prev}Workspace wrap around when going past the last workspace, whereas {Right,Left}Workspace do not\.
\fIoptions\fR is one or more of the following, space delimited:
.RS4
.PP
\fBstatic\fR
.RS4
Instead of moving in order of most\-recent focus, move in order of when the window was opened (or, the order shown in the iconbar)\.
.RE
.PP
\fBgroups\fR
.RS4
Only include the current tab in windows with multiple tabs\.
.RE
.sp
If
\fIpattern\fR
arguments are supplied, only windows that match all the patterns are considered \- all others are skipped\. See the section
\fBCLIENT PATTERNS\fR
below for more information\.
.sp
This pair of commands has a special side\-effect when the keybinding used has a modifier \- It will temporarily raise the cycled window to the front so you can see it, but if you continue holding down the modifier and press the key again (For example, keep holding "Alt" while you tap the "Tab" key a few times), fluxbox will lower the window again when you move on to the next one\. This allows you to preview the windows in order, but does not change the order in doing so\.
Probably the most\-used binding of all\. Passes all the arguments to your
\fB$SHELL\fR
(or /bin/sh if $SHELL is not set)\. You can use this to launch applications, run shell scripts, etc\. Since all arguments are passed verbatim to the shell, you can use environment variables, pipes, or anything else the shell can do\. Note that processes only see environment variables that were set before fluxbox started (such as in ~/\.fluxbox/startup), or any that are set via the Export or SetEnv commands, below\.
.RE
.PP
\fBCommandDialog\fR
.RS4
Pops up a dialog box that lets you type in any of these commands manually\.
Many of the more advanced commands take a \fIpattern\fR argument, which allows you to direct the action at a specific window or set of windows which match the properties specified in the \fIpattern\fR\. A \fIpattern\fR looks like this:
.sp
([\fIpropertyname\fR[!]=]\fIregexp\fR) \&...
.sp
That is, one or more match definitions, followed by an optional limit on the number of windows to match\.
.sp
Match definitions are enclosed in parentheses \fB(\fR\&...\fB)\fR, and if no \fIpropertyname\fR is given then \fBName\fR is assumed\. The \fIregexp\fR can contain any regular expression, or the special value \fB[current]\fR, which matches the corresponding value of the currently focused window\. See \fIregex(7)\fR for more information on acceptable regular expressions\.
.sp
You can use \fB=\fR to test for equality or \fB!=\fR to test for inequality\.
.PP
The following values are accepted for \fIpropertyname\fR:
.RS4
.PP
\fBName\fR
.RS4
A string, corresponding to the CLASSNAME property\.
.RE
.PP
\fBClass\fR
.RS4
A string, corresponding to the CLASSCLASS property\.
.RE
.PP
\fBTitle\fR
.RS4
A string, corresponding to the window title\.
.RE
.PP
\fBRole\fR
.RS4
A string, corresponding to the ROLE property\.
.RE
.PP
\fBTransient\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window is transient (typically, a popup dialog) or not\.
.RE
.PP
\fBMaximized\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window is maximized or not\.
.RE
.PP
\fBMinimized\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window is minimized (iconified) or not\.
.RE
.PP
\fBShaded\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window is shaded or not\.
.RE
.PP
\fBStuck\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window is sticky (on all workspaces) or not\.
.RE
.PP
\fBFocusHidden\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window has asked to be left off the focus list (or, the alt\-tab list), or not\.
.RE
.PP
\fBIconHidden\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window has asked to be left off the icon list (or, the taskbar), or not\.
.RE
.PP
\fBUrgent\fR
.RS4
Either
\fByes\fR
or
\fBno\fR, depending on whether the window has the urgent hint set\.
.RE
.PP
\fBWorkspace\fR
.RS4
A number corresponding to the workspace number to which the window is attached\. The first workspace here is
\fB0\fR\.
.RE
.PP
\fBWorkspaceName\fR
.RS4
A string corresponding to the name of the workspace to which the window is attached\.
.RE
.PP
\fBHead\fR
.RS4
The number of the display head to which the window is attached\. You may match this against the special value
\fB[mouse]\fR
which refers to the head where the mouse pointer currently resides\.
.RE
.PP
\fBLayer\fR
.RS4
The string name of the window\'s layer, which is one of
\fBExample\ 2.\ Matches any windows with the CLASSNAME of "xterm"\fR
.sp
.RS4
.nf
(xterm)
.fi
.RE
.PP
\fBExample\ 3.\ Matches any windows with the same CLASSNAME as the currently focused window\fR
.sp
.RS4
.nf
(Name=[current])
.fi
.RE
.PP
\fBExample\ 4.\ Matches any windows on the same head as the mouse but on a different layer than the currently focused window\fR
.sp
.RS4
.nf
(Head=[mouse]) (Layer!=[current])
.fi
.RE
.SH"FILES"
.PP
~/\.fluxbox/keys
.RS4
This is the default location for the keybinding definitions\.
.RE
.PP
/usr/X11R6/include/X11/keysymdef\.h
.RS4
X key names are in this file\.
.RE
.PP
/usr/X11R6/lib/X11/XKeysymDB
.RS4
X key names are also in this file\.
.RE
.SH"RESOURCES"
.PP
session\.keyFile: <location>
.RS4
This may be set to override the location of the keybinding definitions\.
.RE
.SH"ENVIRONMENT"
Remember that \fBExecCommand\fR command can take advantage of other environment variables if they are set before fluxbox is started, or via the \fBExport\fR or \fBSetEnv\fR commands\. For example, if \fB$TERM\fR is set, it could be use like this:
.sp
.sp
.RS4
.nf
Mod1 x :ExecCommand $TERM
.fi
.RE
For more information about environment variables, see your shell\'s manual\.
.sp
.SH"EXAMPLES"
Here are some interesting and/or useful examples you can do with your keys file\.
.sp
.sp
.RS4
.nf
# Mod4+drag moves a window
OnWindow Mod4 Mouse1 :StartMoving
# If any xterm windows are open, cycle through them\. If none are open, open
# one:
Mod4 t :If {Some Matches (xterm)} {NextWindow (xterm)} {Exec xterm}