diff options
author | koekeishiya <aasvi93@hotmail.com> | 2019-02-23 17:18:49 +0100 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2019-02-23 17:18:49 +0100 |
commit | 5287a3192799d8f9bbdca01fa457cd6cb3e7eba5 (patch) | |
tree | b78deccf346f047048581cc684ba6044b336106d /src/hotkey.c | |
parent | 0e703c3f275f6d4477f452acfb9cf9c73b9d9f1e (diff) | |
download | skhd-5287a3192799d8f9bbdca01fa457cd6cb3e7eba5.tar.gz skhd-5287a3192799d8f9bbdca01fa457cd6cb3e7eba5.zip |
#62 implement option to unbind certain applications etc.
Diffstat (limited to 'src/hotkey.c')
-rw-r--r-- | src/hotkey.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/hotkey.c b/src/hotkey.c index 0c8b9f0..2f0df3a 100644 --- a/src/hotkey.c +++ b/src/hotkey.c @@ -145,14 +145,21 @@ should_capture_hotkey(uint32_t capture) internal inline char * find_process_command_mapping(struct hotkey *hotkey, uint32_t *capture, struct carbon_event *carbon) { + char *result = NULL; + bool found = false; + for (int i = 0; i < buf_len(hotkey->process_name); ++i) { if (same_string(carbon->process_name, hotkey->process_name[i])) { - return hotkey->command[i]; + result = hotkey->command[i]; + found = true; + break; } } - *capture &= ~HOTKEY_FOUND; - return NULL; + if (!found) result = hotkey->wildcard_command; + if (!result) *capture &= ~HOTKEY_FOUND; + + return result; } bool find_and_exec_hotkey(struct hotkey *k, struct table *t, struct mode **m, struct carbon_event *carbon) |