aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-01-05 03:22:38 +0100
committerdec05eba <dec05eba@protonmail.com>2025-01-05 03:22:38 +0100
commitfa5b7a0c751c8d8e37a173df09b7b28733f8df5e (patch)
treecb1fb084e5acf256a3e50677bd8bec33b15059ff /tools
parent52ce22ae22670b11c2bc5fac0583e1a4aa4e19f0 (diff)
Only grab left alt, to allow altgr+z to be used for keyboard that type ż with itHEADmaster
Diffstat (limited to 'tools')
-rw-r--r--tools/gsr-global-hotkeys/keyboard_event.c9
-rw-r--r--tools/gsr-global-hotkeys/keyboard_event.h9
-rw-r--r--tools/gsr-global-hotkeys/main.c12
-rw-r--r--tools/gsr-ui-cli/main.c1
4 files changed, 18 insertions, 13 deletions
diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c
index 79e7f17..203dc00 100644
--- a/tools/gsr-global-hotkeys/keyboard_event.c
+++ b/tools/gsr-global-hotkeys/keyboard_event.c
@@ -165,7 +165,8 @@ static void keyboard_event_process_input_event_data(keyboard_event *self, event_
default: {
const bool shift_pressed = self->lshift_button_state == KEYBOARD_BUTTON_PRESSED || self->rshift_button_state == KEYBOARD_BUTTON_PRESSED;
const bool ctrl_pressed = self->lctrl_button_state == KEYBOARD_BUTTON_PRESSED || self->rctrl_button_state == KEYBOARD_BUTTON_PRESSED;
- const bool alt_pressed = self->lalt_button_state == KEYBOARD_BUTTON_PRESSED || self->ralt_button_state == KEYBOARD_BUTTON_PRESSED;
+ const bool lalt_pressed = self->lalt_button_state == KEYBOARD_BUTTON_PRESSED;
+ const bool ralt_pressed = self->ralt_button_state == KEYBOARD_BUTTON_PRESSED;
const bool meta_pressed = self->lmeta_button_state == KEYBOARD_BUTTON_PRESSED || self->rmeta_button_state == KEYBOARD_BUTTON_PRESSED;
//fprintf(stderr, "pressed key: %d, state: %d, shift: %s, ctrl: %s, alt: %s, meta: %s\n", event.code, event.value,
// shift_pressed ? "yes" : "no", ctrl_pressed ? "yes" : "no", alt_pressed ? "yes" : "no", meta_pressed ? "yes" : "no");
@@ -174,8 +175,10 @@ static void keyboard_event_process_input_event_data(keyboard_event *self, event_
modifiers |= KEYBOARD_MODKEY_SHIFT;
if(ctrl_pressed)
modifiers |= KEYBOARD_MODKEY_CTRL;
- if(alt_pressed)
- modifiers |= KEYBOARD_MODKEY_ALT;
+ if(lalt_pressed)
+ modifiers |= KEYBOARD_MODKEY_LALT;
+ if(ralt_pressed)
+ modifiers |= KEYBOARD_MODKEY_RALT;
if(meta_pressed)
modifiers |= KEYBOARD_MODKEY_SUPER;
diff --git a/tools/gsr-global-hotkeys/keyboard_event.h b/tools/gsr-global-hotkeys/keyboard_event.h
index 5310aca..0283afd 100644
--- a/tools/gsr-global-hotkeys/keyboard_event.h
+++ b/tools/gsr-global-hotkeys/keyboard_event.h
@@ -18,10 +18,11 @@
#define MAX_EVENT_POLLS 32
typedef enum {
- KEYBOARD_MODKEY_ALT = 1 << 0,
- KEYBOARD_MODKEY_SUPER = 1 << 1,
- KEYBOARD_MODKEY_CTRL = 1 << 2,
- KEYBOARD_MODKEY_SHIFT = 1 << 3
+ KEYBOARD_MODKEY_LALT = 1 << 0,
+ KEYBOARD_MODKEY_RALT = 1 << 2,
+ KEYBOARD_MODKEY_SUPER = 1 << 3,
+ KEYBOARD_MODKEY_CTRL = 1 << 4,
+ KEYBOARD_MODKEY_SHIFT = 1 << 5
} keyboard_modkeys;
typedef enum {
diff --git a/tools/gsr-global-hotkeys/main.c b/tools/gsr-global-hotkeys/main.c
index 6f057a7..2524b45 100644
--- a/tools/gsr-global-hotkeys/main.c
+++ b/tools/gsr-global-hotkeys/main.c
@@ -16,12 +16,12 @@ typedef struct {
#define NUM_GLOBAL_HOTKEYS 6
static global_hotkey global_hotkeys[NUM_GLOBAL_HOTKEYS] = {
- { .key = KEY_Z, .modifiers = KEYBOARD_MODKEY_ALT, .action = "show_hide" },
- { .key = KEY_F9, .modifiers = KEYBOARD_MODKEY_ALT, .action = "record" },
- { .key = KEY_F7, .modifiers = KEYBOARD_MODKEY_ALT, .action = "pause" },
- { .key = KEY_F8, .modifiers = KEYBOARD_MODKEY_ALT, .action = "stream" },
- { .key = KEY_F10, .modifiers = KEYBOARD_MODKEY_ALT | KEYBOARD_MODKEY_SHIFT, .action = "replay_start" },
- { .key = KEY_F10, .modifiers = KEYBOARD_MODKEY_ALT, .action = "replay_save" }
+ { .key = KEY_Z, .modifiers = KEYBOARD_MODKEY_LALT, .action = "show_hide" },
+ { .key = KEY_F9, .modifiers = KEYBOARD_MODKEY_LALT, .action = "record" },
+ { .key = KEY_F7, .modifiers = KEYBOARD_MODKEY_LALT, .action = "pause" },
+ { .key = KEY_F8, .modifiers = KEYBOARD_MODKEY_LALT, .action = "stream" },
+ { .key = KEY_F10, .modifiers = KEYBOARD_MODKEY_LALT | KEYBOARD_MODKEY_SHIFT, .action = "replay_start" },
+ { .key = KEY_F10, .modifiers = KEYBOARD_MODKEY_LALT, .action = "replay_save" }
};
static bool on_key_callback(uint32_t key, uint32_t modifiers, int press_status, void *userdata) {
diff --git a/tools/gsr-ui-cli/main.c b/tools/gsr-ui-cli/main.c
index e30867b..bcb5c81 100644
--- a/tools/gsr-ui-cli/main.c
+++ b/tools/gsr-ui-cli/main.c
@@ -50,6 +50,7 @@ static void usage(void) {
printf(" toggle-stream Start/stop streaming.\n");
printf(" toggle-replay Start/stop replay.\n");
printf(" replay-save Save replay.\n");
+ printf("\n");
printf("EXAMPLES:\n");
printf(" gsr-ui-cli toggle-show\n");
printf(" gsr-ui-cli toggle-record\n");