aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-25 01:21:23 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-25 01:21:23 +0100
commitd9a1e5c2eb2fe9411a01b50915b9a919d089d64b (patch)
tree7998b7d6b9694e7e330b0ef1761c066c559f135e
parentb6c59e1049eee7634931464b9f4958be9ae4faa0 (diff)
Add option to press backspace to remove hotkey
-rw-r--r--TODO10
-rw-r--r--src/gui/GlobalSettingsPage.cpp19
2 files changed, 24 insertions, 5 deletions
diff --git a/TODO b/TODO
index 3675ffc..7119dcf 100644
--- a/TODO
+++ b/TODO
@@ -126,3 +126,13 @@ Add support for window capture. This should not prompt for window selection dire
For screenshots window capture should exist but "follow focused" option should not exist.
Improve audio design. It should have a button to add/remove audio tracks and button to add audio into each audio track separately and "record audio from all applications except the selected ones" for each audio track. Then also remove the "merge audio tracks" option.
+
+Make it possible to take a screenshot through a button in the ui instead of having to use hotkey.
+
+Handle failing to save a replay. gsr should output "failed to save replay, or something like that" to make it possible to detect that.
+
+Dont allow saving replay while a replay save is in progress.
+
+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.
diff --git a/src/gui/GlobalSettingsPage.cpp b/src/gui/GlobalSettingsPage.cpp
index a65cf8f..0abb4f9 100644
--- a/src/gui/GlobalSettingsPage.cpp
+++ b/src/gui/GlobalSettingsPage.cpp
@@ -94,7 +94,7 @@ namespace gsr {
mgl::Text title_text("Press a key combination to use for the hotkey \"" + hotkey_configure_action_name + "\":", get_theme().title_font);
mgl::Text hotkey_text(configure_hotkey_button->get_text(), get_theme().top_bar_font);
- mgl::Text description_text("The hotkey has to contain one or more of these keys: Alt, Ctrl, Shift and Super. Press Esc to cancel.", get_theme().body_font);
+ mgl::Text description_text("The hotkey has to contain one or more of these keys: Alt, Ctrl, Shift and Super. Press Esc to cancel or Backspace to remove the hotkey.", get_theme().body_font);
const float text_max_width = std::max(title_text.get_bounds().size.x, std::max(hotkey_text.get_bounds().size.x, description_text.get_bounds().size.x));
const float padding_horizontal = int(get_theme().window_height * 0.01f);
@@ -470,6 +470,13 @@ namespace gsr {
if(event.key.code == mgl::Keyboard::Escape)
return false;
+ if(event.key.code == mgl::Keyboard::Backspace) {
+ configure_config_hotkey = {mgl::Keyboard::Unknown, 0};
+ configure_hotkey_button->set_text("");
+ configure_hotkey_stop_and_save();
+ return false;
+ }
+
if(mgl::Keyboard::key_is_modifier(event.key.code)) {
configure_config_hotkey.modifiers |= mgl_modifier_to_hotkey_modifier(event.key.code);
configure_hotkey_button->set_text(configure_config_hotkey.to_string());
@@ -612,10 +619,12 @@ namespace gsr {
ConfigHotkey *config_hotkey = configure_hotkey_get_config_by_active_type();
if(config_hotkey_button && config_hotkey) {
bool hotkey_used_by_another_action = false;
- for_each_config_hotkey([&](ConfigHotkey *config_hotkey_item) {
- if(config_hotkey_item != config_hotkey && *config_hotkey_item == configure_config_hotkey)
- hotkey_used_by_another_action = true;
- });
+ if(configure_config_hotkey.key != mgl::Keyboard::Unknown) {
+ for_each_config_hotkey([&](ConfigHotkey *config_hotkey_item) {
+ if(config_hotkey_item != config_hotkey && *config_hotkey_item == configure_config_hotkey)
+ hotkey_used_by_another_action = true;
+ });
+ }
if(hotkey_used_by_another_action) {
const std::string error_msg = "The hotkey \"" + configure_config_hotkey.to_string() + " is already used for something else";