diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-03-25 03:50:32 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-03-25 03:50:32 +0100 |
commit | eaa84b057cf01534858d8adc8ccf433429f229e3 (patch) | |
tree | b2bf4fc88afaa857d49d39a38da97ec861a019b2 /src | |
parent | 8ca1533825eb2fcdbd63bb295ac5351869ad8509 (diff) |
Shift+Alt+F1 to start/stop replay
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index fd0267e..dfa4276 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -972,7 +972,7 @@ static GtkWidget* create_replay_page(GtkApplication *app, GtkStack *stack) { gtk_grid_set_column_spacing(grid, 10); gtk_widget_set_margin(GTK_WIDGET(grid), 10, 10, 10, 10); - GtkWidget *hotkey_label = gtk_label_new("Press Alt+F1 to save the replay"); + GtkWidget *hotkey_label = gtk_label_new("Press Shift+Alt+F1 to start/stop the replay and Alt+F1 to save"); gtk_grid_attach(grid, hotkey_label, 0, 0, 3, 1); gtk_grid_attach(grid, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), 0, 1, 3, 1); @@ -1155,6 +1155,8 @@ static GdkFilterReturn hotkey_filter_callback(GdkXEvent *xevent, GdkEvent *event keypress_toggle_recording(recording, start_recording_button, on_start_recording_button_click, page_navigation_userdata->app); } else if(visible_page == page_navigation_userdata->streaming_page) { keypress_toggle_recording(streaming, start_streaming_button, on_start_streaming_button_click, page_navigation_userdata->app); + } else if(visible_page == page_navigation_userdata->replay_page && (ev->xkey.state & ShiftMask)) { + keypress_toggle_recording(replaying, start_replay_button, on_start_replay_button_click, page_navigation_userdata->app); } else if(visible_page == page_navigation_userdata->replay_page && replaying && gpu_screen_recorder_process != -1) { on_replay_save_button_click(nullptr, page_navigation_userdata->app); } @@ -1183,8 +1185,10 @@ static void grabkeys(Display *display) { Window root_window = DefaultRootWindow(display); unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - for(int i = 0; i < 4; ++i) + for(int i = 0; i < 4; ++i) { XGrabKey(display, XKeysymToKeycode(display, XK_F1), Mod1Mask|modifiers[i], root_window, False, GrabModeAsync, GrabModeAsync); + XGrabKey(display, XKeysymToKeycode(display, XK_F1), Mod1Mask|ShiftMask|modifiers[i], root_window, False, GrabModeAsync, GrabModeAsync); + } XSync(display, False); XSetErrorHandler(prev_error_handler); |