diff --git a/src/config.c b/src/config.c index 41462ff..74894b8 100644 --- a/src/config.c +++ b/src/config.c @@ -30,6 +30,7 @@ #include #include #include +#include // Global configuration instance static turtile_config_t *config_instance = NULL; @@ -79,8 +80,7 @@ void load_keybinds(config_t *cfg, const char *value) { config_setting_t *mod_setting = config_setting_lookup(keybind_setting, "mod"); uint32_t mods = 0; if (mod_setting) { - int mod_count = config_setting_length(mod_setting); - for (int j = 0; j < mod_count; j++) { + for (int j = 0; j < config_setting_length(mod_setting); j++) { const char *mod_str = config_setting_get_string_elem(mod_setting, j); if (!mod_str) { wlr_log(WLR_ERROR, "Invalid modifier string in configuration"); @@ -96,6 +96,8 @@ void load_keybinds(config_t *cfg, const char *value) { mods |= WLR_MODIFIER_ALT; } else if (strstr(mod_str, "mod4")) { mods |= WLR_MODIFIER_LOGO; + } else if (strstr(mod_str, "super")) { + mods |= WLR_MODIFIER_LOGO; } else if (strstr(mod_str, "mod2")) { mods |= WLR_MODIFIER_MOD2; } else { @@ -115,7 +117,7 @@ void load_keybinds(config_t *cfg, const char *value) { } // Convert key string to keysym - xkb_keysym_t key = xkb_keysym_from_name(key_str, XKB_KEYSYM_CASE_INSENSITIVE); + xkb_keysym_t key = xkb_keysym_from_name(key_str, XKB_KEYSYM_NO_FLAGS); if (key == XKB_KEY_NoSymbol) { wlr_log(WLR_ERROR, "Invalid key name '%s' in configuration", key_str); continue; diff --git a/src/keyboard.c b/src/keyboard.c index 1275771..cbfb3f1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -51,11 +51,10 @@ void keyboard_handle_modifiers( bool handle_keybinding(struct turtile_server *server, uint32_t modifiers, xkb_keysym_t sym) { turtile_keybind_t *keybind; + /* wlr_log(WLR_INFO, "key event: %d %d", modifiers, sym); */ wl_list_for_each(keybind, &config_get_instance()->keybinds, link) { // Check if both the key and the modifiers match - wlr_log(WLR_INFO, "keybind: %d %d", keybind->mods, keybind->key); - wlr_log(WLR_INFO, "mods: %d", modifiers); - wlr_log(WLR_INFO, "key: %d", sym); + /* wlr_log(WLR_INFO, "keybind: %d %d", keybind->mods, keybind->key); */ if ((keybind->mods == modifiers) && (keybind->key == sym)) { wlr_log(WLR_INFO, "Executing command: %s", keybind->cmd); if (fork() == 0) diff --git a/src/toplevel.h b/src/toplevel.h index 0f81bef..ddb7bb6 100644 --- a/src/toplevel.h +++ b/src/toplevel.h @@ -24,8 +24,6 @@ #define TURTILE_TOPLEVEL_H #include "cursor.h" -#include "src/output.h" -#include #include #include diff --git a/tests/test.cfg b/tests/test.cfg index d85abaf..3fd7712 100644 --- a/tests/test.cfg +++ b/tests/test.cfg @@ -9,6 +9,6 @@ workspaces = ( ); keybinds = ( - {mod = ["mod4", "shift"], key = "f3", cmd = "./build/ttcli workspace switch main"}, - {mod = ["mod4", "shift"], key = "f4", cmd = "./build/ttcli workspace switch test"} + {mod = ["mod4", "shift"], key = "F3", cmd = "./build/ttcli workspace switch main"}, + {mod = ["mod4", "shift"], key = "F4", cmd = "./build/ttcli workspace switch test"} );