From: Michael Stapelberg Date: Mon, 11 Jul 2011 17:41:15 +0000 (+0200) Subject: config-wizard: correctly handle shift-only bindings X-Git-Tag: tree-pr4~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85289636a6470c6070fd93cbdf68fcf645c693fa;p=i3%2Fi3 config-wizard: correctly handle shift-only bindings --- 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); } ;