From 38feee9f29c134d7734f76db8af196618380e8f5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 11 Apr 2025 21:51:38 +0200 Subject: Fix unable to change hotkey settings while recording --- tools/gsr-global-hotkeys/README.md | 6 ++++++ tools/gsr-global-hotkeys/keyboard_event.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'tools/gsr-global-hotkeys') diff --git a/tools/gsr-global-hotkeys/README.md b/tools/gsr-global-hotkeys/README.md index 8744107..38585c1 100644 --- a/tools/gsr-global-hotkeys/README.md +++ b/tools/gsr-global-hotkeys/README.md @@ -18,4 +18,10 @@ To unbind all keys send `unbind_all` to the programs stdin, for example ``` unbind_all +``` +## Exit +To close gsr-global-hotkeys send `exit` to the programs stdin, for example: +``` +exit + ``` \ No newline at end of file diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c index e5221dc..bcfae6b 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.c +++ b/tools/gsr-global-hotkeys/keyboard_event.c @@ -707,8 +707,11 @@ static void keyboard_event_parse_stdin_command(keyboard_event *self, const char } self->num_global_hotkeys = 0; fprintf(stderr, "Info: unbinded all hotkeys\n"); + } else if(strncmp(command, "exit", 4) == 0) { + self->stdin_failed = true; + fprintf(stderr, "Info: received exit command\n"); } else { - fprintf(stderr, "Warning: got invalid command: \"%s\", expected command to start with either \"bind\" or \"unbind_all\"\n", command); + fprintf(stderr, "Warning: got invalid command: \"%s\", expected command to start with either \"bind\", \"unbind_all\" or \"exit\"\n", command); } } -- cgit v1.2.3-70-g09d2