diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-11-27 16:24:18 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-11-27 16:24:18 +0000 |
commit | 1341ef3ccce17628bebba4834706f616976d5b61 (patch) | |
tree | ed54f9b6a7e41ae9777b8b95bb6361eab749b686 /app | |
parent | 1b9906d9a864199865b8af374c2e5e12f49d7bc7 (diff) |
Remove the option to bind a key by keycode with brackets; it never
worked (and no one complained!). While it's fairly easy to fix, users
should be using keysym names and not keycodes.
Discussed at length months ago with todd@, matthieu@ and Owain.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/conf.c | 19 | ||||
-rw-r--r-- | app/cwm/cwmrc.5 | 10 | ||||
-rw-r--r-- | app/cwm/xevents.c | 6 |
3 files changed, 10 insertions, 25 deletions
diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 689cbf2ae..60c92933c 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.148 2013/10/20 01:55:32 okan Exp $ + * $OpenBSD: conf.c,v 1.149 2013/11/27 16:24:17 okan Exp $ */ #include <sys/param.h> @@ -479,17 +479,8 @@ conf_bind_kbd(struct conf *c, char *name, char *binding) substring = conf_bind_getmask(name, &mask); current_binding->modmask |= mask; - if (substring[0] == '[' && - substring[strlen(substring)-1] == ']') { - sscanf(substring, "[%d]", ¤t_binding->keycode); - current_binding->keysym = NoSymbol; - } else { - current_binding->keycode = 0; - current_binding->keysym = XStringToKeysym(substring); - } - - if (current_binding->keysym == NoSymbol && - current_binding->keycode == 0) { + current_binding->keysym = XStringToKeysym(substring); + if (current_binding->keysym == NoSymbol) { free(current_binding); return; } @@ -530,9 +521,7 @@ conf_unbind_kbd(struct conf *c, struct keybinding *unbind) if (key->modmask != unbind->modmask) continue; - if ((key->keycode != 0 && key->keysym == NoSymbol && - key->keycode == unbind->keycode) || - key->keysym == unbind->keysym) { + if (key->keysym == unbind->keysym) { TAILQ_REMOVE(&c->keybindingq, key, entry); if (key->argtype & ARG_CHAR) free(key->argument.c); diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5 index 6d4684ffa..cf9103266 100644 --- a/app/cwm/cwmrc.5 +++ b/app/cwm/cwmrc.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cwmrc.5,v 1.54 2013/07/08 18:39:20 okan Exp $ +.\" $OpenBSD: cwmrc.5,v 1.55 2013/11/27 16:24:17 okan Exp $ .\" .\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 8 2013 $ +.Dd $Mdocdate: November 27 2013 $ .Dt CWMRC 5 .Os .Sh NAME @@ -84,10 +84,8 @@ The Mod4 key (normally the windows key). .Pp The .Sq - -should be followed by either a keysym name, taken from -.Pa /usr/X11R6/include/X11/keysymdef.h , -or a numerical keycode value enclosed in -.Dq [] . +should be followed by a keysym name, taken from +.Pa /usr/X11R6/include/X11/keysymdef.h . The .Ar command may either be one from the diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index f7f772a91..0d0426d0b 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.93 2013/11/27 00:01:23 okan Exp $ + * $OpenBSD: xevents.c,v 1.94 2013/11/27 16:24:17 okan Exp $ */ /* @@ -275,9 +275,7 @@ xev_handle_keypress(XEvent *ee) if ((kb->modmask | modshift) != e->state) continue; - if ((kb->keycode != 0 && kb->keysym == NoSymbol && - kb->keycode == e->keycode) || kb->keysym == - (modshift == 0 ? keysym : skeysym)) + if (kb->keysym == (modshift == 0 ? keysym : skeysym)) break; } |