diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | TODO | 8 | ||||
-rw-r--r-- | tools/gsr-global-hotkeys/keyboard_event.c | 9 | ||||
-rw-r--r-- | tools/gsr-global-hotkeys/keyboard_event.h | 9 | ||||
-rw-r--r-- | tools/gsr-global-hotkeys/main.c | 12 | ||||
-rw-r--r-- | tools/gsr-ui-cli/main.c | 1 |
6 files changed, 29 insertions, 19 deletions
@@ -7,9 +7,10 @@ Note: This software is still in early alpha. Expect bugs, and please report any You can report an issue by emailing the issue to dec05eba@protonmail.com. # Usage -Run `gsr-ui` and press `Alt+Z` to show/hide the UI. You can start the overlay UI at system startup by running `systemctl enable --now --user gpu-screen-recorder-ui`. +Run `gsr-ui` and press `Left Alt+Z` to show/hide the UI. You can start the overlay UI at system startup by running `systemctl enable --now --user gpu-screen-recorder-ui`. There is also an option in the settings to enable/disable starting the program on system startup. This option only works on systems that use systemd. -You have to manually add `gsr-ui` to system startup on systems that uses another init system. +You have to manually add `gsr-ui` to system startup on systems that uses another init system.\ +A program called `gsr-ui-cli` is also installed when installing this software. This can be used to remotely control the UI. Run `gsr-ui-cli --help` to list the available commands. # Installation If you are using an Arch Linux based distro then you can find gpu screen recorder ui on aur under the name gpu-screen-recorder-ui (`yay -S gpu-screen-recorder-ui`).\ @@ -34,7 +35,7 @@ There are also additional dependencies needed at runtime: * [GPU Screen Recorder Notification](https://git.dec05eba.com/gpu-screen-recorder-notification/) ## Program behavior notes -At the moment different keyboard layouts are not supported. The physical layout of keys are used for global hotkeys. If your Z and Y keys are swapped for example then you need to press Alt+Y instead of Alt+Z to open/hide the UI.\ +At the moment different keyboard layouts are not supported. The physical layout of keys are used for global hotkeys. If your Z and Y keys are swapped for example then you need to press Left Alt+Y instead of Left Alt+Z to open/hide the UI.\ If you experience this issue then please email dec05eba@protonmail.com to get it fixed.\ This program has to grab all keyboards and create a virtual keyboard (`gsr-ui virtual keyboard`) to make global hotkeys work on all Wayland compositors. This might cause issues for you if you use input remapping software. To workaround this you can go into settings and select "Only grab virtual devices" @@ -56,5 +57,5 @@ If you want to donate you can donate via bitcoin or monero. # Known issues * When the UI is open the wallpaper is shown instead of the game on Hyprland and Sway. This is an issue with Hyprland and Sway. It cant be fixed until the UI is redesigned to not be a fullscreen overlay. -* Different keyboard layouts are not supported at the moment. The physical layout of keys are used for global hotkeys. If your Z and Y keys are swapped for example then you need to press Alt+Y instead of Alt+Z to open/hide the UI. If you experience this issue then please email dec05eba@protonmail.com to get it fixed. +* Different keyboard layouts are not supported at the moment. The physical layout of keys are used for global hotkeys. If your Z and Y keys are swapped for example then you need to press Left Alt+Y instead of Left Alt+Z to open/hide the UI. If you experience this issue then please email dec05eba@protonmail.com to get it fixed. * The mouse position can sometimes shift when opening the UI. @@ -92,7 +92,7 @@ Move ui hover code from ::draw to ::on_event, to properly handle widget event st Save audio devices by name instead of id. This is more robust since audio id can change(?). -Improve linux global hotkeys startup time by parsing /proc/bus/input/devices instead of ioctl. +Improve linux global hotkeys startup time by parsing /proc/bus/input/devices instead of ioctl. <- Do this! We can get the name of the running steam game without x11 by listing processes and finding the one that runs a program called "reaper" with the arguments SteamLaunch AppId=<number>. The binary comes after the -- argument, get the name of the game by parsing out name from that, in the format steamapps/common/<name>/. @@ -107,4 +107,8 @@ Keyboard leds get turned off when stopping gsr-global-hotkeys (for example numlo Implement hotkey changing in global settings by getting mgl key events. During this time gsr-global-hotkey would either need to be paused or add code in the callback handler for the existing hotkeys since they are grabbing hotkeys. This can only be done after gsr-global-hotkeys properly handle different keyboard layouts to make sure mgl keys match gsr-global-hotkey keys. -Re-enable hotkey enable/disable section for flatpak.
\ No newline at end of file +Re-enable hotkey disable option for flatpak. + +Make gsr-ui flatpak systemd work nicely with non-flatpak gsr-ui. Maybe change ExecStart to do flatpak run ... || gsr-ui, but make it run as a shell command first with /bin/sh -c "". + +When enabling X11 global hotkey again only grab lalt, not ralt.
\ 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 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"); |