mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Document cwm's keybinding support. It was already there, but not in the manpage.
While I'm here add support for extra modifier keys. "commit commit!" jasper@, ok todd@.
This commit is contained in:
parent
699b048959
commit
e64e1709ba
65
conf.c
65
conf.c
@ -386,26 +386,47 @@ struct {
|
||||
{ "lower", kbfunc_client_lower, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "raise", kbfunc_client_raise, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "search", kbfunc_client_search, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "menusearch", kbfunc_menu_search, 0, 0 },
|
||||
{ "hide", kbfunc_client_hide, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "cycle", kbfunc_client_cycle, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "rcycle", kbfunc_client_rcycle, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "label", kbfunc_client_label, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "delete", kbfunc_client_delete, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "groupselect", kbfunc_client_groupselect, 0, 0 },
|
||||
{ "group1", kbfunc_client_group, 0, (void *) 1 },
|
||||
{ "group2", kbfunc_client_group, 0, (void *) 2 },
|
||||
{ "group3", kbfunc_client_group, 0, (void *) 3 },
|
||||
{ "group4", kbfunc_client_group, 0, (void *) 4 },
|
||||
{ "group5", kbfunc_client_group, 0, (void *) 5 },
|
||||
{ "group6", kbfunc_client_group, 0, (void *) 6 },
|
||||
{ "group7", kbfunc_client_group, 0, (void *) 7 },
|
||||
{ "group8", kbfunc_client_group, 0, (void *) 8 },
|
||||
{ "group9", kbfunc_client_group, 0, (void *) 9 },
|
||||
{ "nogroup", kbfunc_client_nogroup, 0, 0},
|
||||
{ "nextgroup", kbfunc_client_nextgroup, 0, 0},
|
||||
{ "prevgroup", kbfunc_client_prevgroup, 0, 0},
|
||||
{ "maximize", kbfunc_client_maximize, KBFLAG_NEEDCLIENT, 0},
|
||||
{ "vmaximize", kbfunc_client_vmaximize, KBFLAG_NEEDCLIENT, 0},
|
||||
{ "group1", kbfunc_client_group, 0, (void *)1 },
|
||||
{ "group2", kbfunc_client_group, 0, (void *)2 },
|
||||
{ "group3", kbfunc_client_group, 0, (void *)3 },
|
||||
{ "group4", kbfunc_client_group, 0, (void *)4 },
|
||||
{ "group5", kbfunc_client_group, 0, (void *)5 },
|
||||
{ "group6", kbfunc_client_group, 0, (void *)6 },
|
||||
{ "group7", kbfunc_client_group, 0, (void *)7 },
|
||||
{ "group8", kbfunc_client_group, 0, (void *)8 },
|
||||
{ "group9", kbfunc_client_group, 0, (void *)9 },
|
||||
{ "nogroup", kbfunc_client_nogroup, 0, 0 },
|
||||
{ "nextgroup", kbfunc_client_nextgroup, 0, 0 },
|
||||
{ "prevgroup", kbfunc_client_prevgroup, 0, 0 },
|
||||
{ "maximize", kbfunc_client_maximize, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "vmaximize", kbfunc_client_vmaximize, KBFLAG_NEEDCLIENT, 0 },
|
||||
{ "exec", kbfunc_exec, 0, 0 },
|
||||
{ "ssh", kbfunc_ssh, 0, 0 },
|
||||
{ "terminal", kbfunc_term, 0, 0 },
|
||||
{ "lock", kbfunc_lock, 0, 0 },
|
||||
{ "moveup", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_UP },
|
||||
{ "movedown", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_DOWN },
|
||||
{ "moveright", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_RIGHT },
|
||||
{ "moveleft", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_LEFT },
|
||||
{ "bigmoveup", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_UP|CWM_BIGMOVE) },
|
||||
{ "bigmovedown", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_DOWN|CWM_BIGMOVE) },
|
||||
{ "bigmoveright", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_RIGHT|CWM_BIGMOVE) },
|
||||
{ "bigmoveleft", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_LEFT|CWM_BIGMOVE) },
|
||||
{ "resizeup", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_UP) },
|
||||
{ "resizedown", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_DOWN },
|
||||
{ "resizeright", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_RIGHT },
|
||||
{ "resizeleft", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_LEFT },
|
||||
{ "bigresizeup", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_UP|CWM_BIGMOVE) },
|
||||
{ "bigresizedown", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_DOWN|CWM_BIGMOVE) },
|
||||
{ "bigresizeright", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_RIGHT|CWM_BIGMOVE) },
|
||||
{ "bigresizeleft", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_LEFT|CWM_BIGMOVE) },
|
||||
{ NULL, NULL, 0, 0},
|
||||
};
|
||||
|
||||
@ -459,6 +480,22 @@ conf_parsekeys(struct conf *c, char *filename)
|
||||
strchr(ent->d_name, 'M') < strchr(ent->d_name, '-'))
|
||||
current_binding->modmask |= Mod1Mask;
|
||||
|
||||
if (strchr(ent->d_name, '2') != NULL &&
|
||||
strchr(ent->d_name, '2') < strchr(ent->d_name, '-'))
|
||||
current_binding->modmask |= Mod2Mask;
|
||||
|
||||
if (strchr(ent->d_name, '3') != NULL &&
|
||||
strchr(ent->d_name, '3') < strchr(ent->d_name, '-'))
|
||||
current_binding->modmask |= Mod3Mask;
|
||||
|
||||
if (strchr(ent->d_name, '4') != NULL &&
|
||||
strchr(ent->d_name, '4') < strchr(ent->d_name, '-'))
|
||||
current_binding->modmask |= Mod4Mask;
|
||||
|
||||
if (strchr(ent->d_name, 'S') != NULL &&
|
||||
strchr(ent->d_name, 'S') < strchr(ent->d_name, '-'))
|
||||
current_binding->modmask |= ShiftMask;
|
||||
|
||||
substring = strchr(ent->d_name, '-') + 1;
|
||||
|
||||
/* If there is no '-' in name, continue as is */
|
||||
|
58
cwm.1
58
cwm.1
@ -258,6 +258,64 @@ class go to the third group:
|
||||
.Bd -literal -offset indent
|
||||
$ ln -s three ~/.calmwm/.autogroup/XTerm
|
||||
.Ed
|
||||
.It Pa ~/.calmwm/.settings
|
||||
Files in this directory cause various configuration options to be
|
||||
set or unset.
|
||||
Currently the only setting availiable is whether or not sticky groups
|
||||
are activated.
|
||||
To activate sticky groups create a file in this directory with the name
|
||||
``sticky''.
|
||||
.It Pa .calmwm/.ignore
|
||||
Any files in this directory cause
|
||||
.Nm
|
||||
to ignore programs by that name by not drawing borders around them.
|
||||
For example the command
|
||||
.Bd -literal -offset indent
|
||||
$ ln -s three ~/.calmwm/.ignore/xclock
|
||||
.Ed
|
||||
will cause any instances of
|
||||
.Xr xclock 1
|
||||
to not have borders.
|
||||
.It Pa .calmwm/.keys
|
||||
Symlinks in this directory cause the creation of keyboard shortcuts.
|
||||
If the directory does not exist, then the default shortcuts will be
|
||||
created; otherwise only the shortcuts defined will be created.
|
||||
The name of a link here is first the modifier keys, followed by a ``-''.
|
||||
The following modifiers are recognised:
|
||||
.Bl -tag -width Ds
|
||||
.It Pa C
|
||||
The Control key.
|
||||
.It Pa M
|
||||
The Meta key.
|
||||
.It Pa S
|
||||
The Shift key.
|
||||
.It Pa 2
|
||||
The Mod2 key.
|
||||
.It Pa 3
|
||||
The Mod3 key.
|
||||
.It Pa 4
|
||||
The Mod4 key (normally the windows key).
|
||||
.El
|
||||
The ``-'' should be followed by either a keysym name, taken from
|
||||
.Pa /usr/X11R6/include/X11/keysymdef.h ,
|
||||
or a numerical keycode value enclosed in ``[]''.
|
||||
The target of the link should be either the name of a task from the
|
||||
``name_to_kbfunc''
|
||||
structure in
|
||||
.Pa /usr/src/xenocara/app/cwm/conf.c ,
|
||||
or, alternatively it should be the commandline that is wished to be executed.
|
||||
For example, to cause
|
||||
.Ic C-M-r
|
||||
to add a label to a window:
|
||||
.Bd -literal -offset indent
|
||||
$ ln -s "label" ~/.calmwm/.keys/CM-r
|
||||
.Ed
|
||||
Launch an xterm running
|
||||
.Xr top 1
|
||||
with C-S-Enter:
|
||||
.Bd -literal -offset indent
|
||||
$ ln -s "/usr/X11R6/bin/xterm -e top" ~/.calmwm/.keys/CS-Return
|
||||
.Ed
|
||||
.El
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
|
Loading…
Reference in New Issue
Block a user