From eb44ceb50fa5b47b78cb98794a8c9f6b424aa000 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Nov 2013 16:24:17 +0000 Subject: 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. --- conf.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 689cbf2..60c9293 100644 --- a/conf.c +++ b/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 @@ -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); -- cgit v1.2.3-2-gb3c3