+ if (parsing_mouse_commands) {
+ int button = atoi(cur_key + sizeof("button") - 1);
+
+ mouse_command_t *current;
+ TAILQ_FOREACH(current, &(config.mouse_commands), commands) {
+ if (current->button == button) {
+ FREE(current->command);
+ sasprintf(&(current->command), "%.*s", len, val);
+ return 1;
+ }
+ }
+
+ mouse_command_t *command = scalloc(sizeof(mouse_command_t));
+ command->button = button;
+ sasprintf(&(command->command), "%.*s", len, val);
+ TAILQ_INSERT_TAIL(&(config.mouse_commands), command, commands);
+ return 1;
+ }
+