aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2018-05-10 15:24:28 +0200
committerkoekeishiya <aasvi93@hotmail.com>2018-05-10 15:24:28 +0200
commit847c2c873c06a3866981834d29eccef1041f5410 (patch)
tree5054c50ee97e522e3514a347970facc8645debd0 /src/parse.c
parentd7f5fd5730ca252c2635efd263ba40282a31ca57 (diff)
downloadskhd-847c2c873c06a3866981834d29eccef1041f5410.tar.gz
skhd-847c2c873c06a3866981834d29eccef1041f5410.zip
#15 modes can now capture keypresses; code cleanup
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index d219d8c..7bde2dc 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -30,6 +30,7 @@ find_or_init_default_mode(struct parser *parser)
(table_hash_func) hash_hotkey,
(table_compare_func) same_hotkey);
+ default_mode->capture = false;
default_mode->command = NULL;
table_add(parser->mode_map, default_mode->name, default_mode);
@@ -286,6 +287,12 @@ parse_mode_decl(struct parser *parser)
(table_hash_func) hash_hotkey,
(table_compare_func) same_hotkey);
+ if (parser_match(parser, Token_Capture)) {
+ mode->capture = true;
+ } else {
+ mode->capture = false;
+ }
+
if (parser_match(parser, Token_Command)) {
mode->command = copy_string_count(parser->previous_token.text, parser->previous_token.length);
} else {