diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-03-14 00:20:08 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-03-14 00:20:08 +0100 |
commit | 6c7158c06d41fd7c77a8a8b9d186440904950f8c (patch) | |
tree | 5ed25cd78c7b90d251f151adfc7a70446ff74fc7 | |
parent | 7d1f6f9a25e1290fe691fd09daaec3990decc8f1 (diff) |
Support more keys for hotkeys (media keys)
-rw-r--r-- | TODO | 11 | ||||
m--------- | depends/mglpp | 0 | ||||
-rw-r--r-- | src/gui/SettingsPage.cpp | 6 | ||||
-rw-r--r-- | tools/gsr-global-hotkeys/keyboard_event.c | 6 |
4 files changed, 18 insertions, 5 deletions
@@ -137,4 +137,13 @@ Make input work with cjk input systems (such as fcitx). System startup option should also support runit and some other init systems, not only soystemd. -Allow using a hotkey such as printscreen or any other non-alphanumeric key without a modifier. Allow that in gsr-ui and gsr-global-hotkeys. Update the ui to match that.
\ No newline at end of file +Allow using a hotkey such as printscreen or any other non-alphanumeric key without a modifier. Allow that in gsr-ui and gsr-global-hotkeys. Update the ui to match that. + +Implement region capture by adding it as a capture target. The region selection should be done in the same way as the gsr-ui overlay works, by doing xi grab and displaying a fullscreen semi-transparent window. + The window however should covert all monitors combined (use XWidthOfScreen/XHeightOfScreen) and selecting a region should make that region fully transparent to make it clear which region is selected. + Clicking instead of dragging should select that monitor (by passing region 0x0+X+Y). + Hide gsr-ui overlay before showing the region capture (the region capture should start when you start recording/screenshot). + +Use x11 shm instead of XGetImage (https://stackoverflow.com/questions/43442675/how-to-use-xshmgetimage-and-xshmputimage). + +Add a hotkey to record/stream/replay/screenshot region. diff --git a/depends/mglpp b/depends/mglpp -Subproject 44f002631fc3ebbaa54846909e422eb757881c8 +Subproject 6341a8aa77761a94e6ef073bccd28f880ee61f9 diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 9394104..e4319ce 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -351,14 +351,14 @@ namespace gsr { list->add_widget(std::move(video_bitrate_entry)); if(type == Type::STREAM) { - auto size_mb_label = std::make_unique<Label>(&get_theme().body_font, "1.92MB", get_color_theme().text_color); + auto size_mb_label = std::make_unique<Label>(&get_theme().body_font, "1.64MB", get_color_theme().text_color); Label *size_mb_label_ptr = size_mb_label.get(); list->add_widget(std::move(size_mb_label)); video_bitrate_entry_ptr->on_changed = [size_mb_label_ptr](const std::string &text) { - const double video_bitrate_mb_per_seconds = (double)atoi(text.c_str()) / 1000LL / 8LL * 1.024; + const double video_bitrate_mbits_per_seconds = (double)atoi(text.c_str()) / 1024.0; char buffer[32]; - snprintf(buffer, sizeof(buffer), "%.2fMB", video_bitrate_mb_per_seconds); + snprintf(buffer, sizeof(buffer), "%.2fMbps", video_bitrate_mbits_per_seconds); size_mb_label_ptr->set_text(buffer); }; } diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c index 6973d4b..f3fba62 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.c +++ b/tools/gsr-global-hotkeys/keyboard_event.c @@ -294,7 +294,11 @@ static bool keyboard_event_try_add_device_if_keyboard(keyboard_event *self, cons unsigned char key_bits[KEY_MAX/8 + 1] = {0}; ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), &key_bits); - const bool supports_key_events = key_bits[KEY_A/8] & (1 << (KEY_A % 8)); + const bool supports_key_a = key_bits[KEY_A/8] & (1 << (KEY_A % 8)); + const bool supports_key_esc = key_bits[KEY_ESC/8] & (1 << (KEY_ESC % 8)); + const bool supports_key_volume_up = key_bits[KEY_VOLUMEUP/8] & (1 << (KEY_VOLUMEUP % 8)); + const bool supports_key_events = supports_key_a || supports_key_esc || supports_key_volume_up; + const bool supports_mouse_events = key_bits[BTN_MOUSE/8] & (1 << (BTN_MOUSE % 8)); //const bool supports_touch_events = key_bits[BTN_TOUCH/8] & (1 << (BTN_TOUCH % 8)); const bool supports_joystick_events = key_bits[BTN_JOYSTICK/8] & (1 << (BTN_JOYSTICK % 8)); |