bugfix: config-parser: bind is a synonym for bindcode

This commit is contained in:
Michael Stapelberg 2012-10-08 13:40:44 +02:00
parent 040a441101
commit ee36c8507e
2 changed files with 28 additions and 26 deletions

View File

@ -17,7 +17,7 @@ state INITIAL:
end -> end ->
'#' -> IGNORE_LINE '#' -> IGNORE_LINE
'set' -> IGNORE_LINE 'set' -> IGNORE_LINE
bindtype = 'bindsym', 'bindcode' -> BINDING bindtype = 'bindsym', 'bindcode', 'bind' -> BINDING
'bar' -> BARBRACE 'bar' -> BARBRACE
'font' -> FONT 'font' -> FONT
'mode' -> MODENAME 'mode' -> MODENAME

View File

@ -179,6 +179,7 @@ CFGFUN(font, const char *font) {
// TODO: refactor with mode_binding // TODO: refactor with mode_binding
CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) { CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) {
Binding *new_binding = scalloc(sizeof(Binding)); Binding *new_binding = scalloc(sizeof(Binding));
DLOG("bindtype %s, modifiers %s, key %s, release %s\n", bindtype, modifiers, key, release);
new_binding->release = (release != NULL ? B_UPON_KEYRELEASE : B_UPON_KEYPRESS); new_binding->release = (release != NULL ? B_UPON_KEYRELEASE : B_UPON_KEYPRESS);
if (strcmp(bindtype, "bindsym") == 0) { if (strcmp(bindtype, "bindsym") == 0) {
new_binding->symbol = sstrdup(key); new_binding->symbol = sstrdup(key);
@ -200,6 +201,7 @@ static struct bindings_head *current_bindings;
CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) { CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) {
Binding *new_binding = scalloc(sizeof(Binding)); Binding *new_binding = scalloc(sizeof(Binding));
DLOG("bindtype %s, modifiers %s, key %s, release %s\n", bindtype, modifiers, key, release);
new_binding->release = (release != NULL ? B_UPON_KEYRELEASE : B_UPON_KEYPRESS); new_binding->release = (release != NULL ? B_UPON_KEYRELEASE : B_UPON_KEYPRESS);
if (strcmp(bindtype, "bindsym") == 0) { if (strcmp(bindtype, "bindsym") == 0) {
new_binding->symbol = sstrdup(key); new_binding->symbol = sstrdup(key);