wizard: actually write the output config

This commit is contained in:
Michael Stapelberg
2011-05-01 13:56:35 +02:00
parent 9101f4cce2
commit 43ec3ddbaf
5 changed files with 146 additions and 14 deletions

View File

@ -89,6 +89,10 @@ static char *modifier_to_string(int modifiers) {
return strdup("Mod1");
else if (modifiers == ((1 << 3) | (1 << 0)))
return strdup("Mod1+shift");
else if (modifiers == (1 << 9))
return strdup("$mod");
else if (modifiers == ((1 << 9) | (1 << 0)))
return strdup("$mod+shift");
else return strdup("UNKNOWN");
}
@ -105,6 +109,7 @@ static char *modifier_to_string(int modifiers) {
%token <number>NUMBER "<number>"
%token <string>STR "<string>"
%token TOKBINDCODE
%token TOKMODVAR "$mod"
%token MODIFIER "<modifier>"
%token TOKCONTROL "control"
%token TOKSHIFT "shift"
@ -148,6 +153,7 @@ binding_modifiers:
binding_modifier:
MODIFIER { $<number>$ = $<number>1; }
| TOKMODVAR { $<number>$ = $<number>1; }
| TOKCONTROL { $<number>$ = (1 << 2); }
| TOKSHIFT { $<number>$ = (1 << 0); }
;