From 85289636a6470c6070fd93cbdf68fcf645c693fa Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 11 Jul 2011 19:41:15 +0200 Subject: [PATCH] config-wizard: correctly handle shift-only bindings --- i3-config-wizard/cfgparse.y | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/i3-config-wizard/cfgparse.y b/i3-config-wizard/cfgparse.y index f2e4a054..018b37b2 100644 --- a/i3-config-wizard/cfgparse.y +++ b/i3-config-wizard/cfgparse.y @@ -86,14 +86,16 @@ char *rewrite_binding(const char *bindingline) { static char *modifier_to_string(int modifiers) { //printf("should convert %d to string\n", modifiers); if (modifiers == (1 << 3)) - return strdup("Mod1"); + return strdup("$mod+"); else if (modifiers == ((1 << 3) | (1 << 0))) - return strdup("Mod1+shift"); + return strdup("$mod+Shift+"); else if (modifiers == (1 << 9)) - return strdup("$mod"); + return strdup("$mod+"); else if (modifiers == ((1 << 9) | (1 << 0))) - return strdup("$mod+shift"); - else return strdup("UNKNOWN"); + return strdup("$mod+Shift+"); + else if (modifiers == (1 << 0)) + return strdup("Shift+"); + else return strdup(""); } %} @@ -139,7 +141,7 @@ bindcode: char *str = XKeysymToString(sym); char *modifiers = modifier_to_string($3); // TODO: modifier to string - asprintf(&(context->result), "bindsym %s+%s %s\n", modifiers, str, $6); + asprintf(&(context->result), "bindsym %s%s %s\n", modifiers, str, $6); free(modifiers); } ; -- 2.39.5