-// TODO: refactor with mode_binding
-CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) {
- 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);
- if (strcmp(bindtype, "bindsym") == 0) {
- new_binding->symbol = sstrdup(key);
- } else {
- // TODO: strtol with proper error handling
- new_binding->keycode = atoi(key);
- if (new_binding->keycode == 0) {
- ELOG("Could not parse \"%s\" as a keycode, ignoring this binding.\n", key);
- return;
- }
- }
- new_binding->mods = modifiers_from_str(modifiers);
- new_binding->command = sstrdup(command);
- TAILQ_INSERT_TAIL(bindings, new_binding, bindings);
+CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command) {
+ configure_binding(bindtype, modifiers, key, release, whole_window, command, DEFAULT_BINDING_MODE);