Add static hotkey text to show that ESC goes back to the previous page/closes the ui

This commit is contained in:
dec05eba
2026-04-12 17:09:58 +02:00
parent d545de687c
commit aec687bf22
10 changed files with 36 additions and 8 deletions

3
TODO
View File

@@ -257,3 +257,6 @@ Webcam resolution list is too long for some people. Fix it by separating resolut
Allow settings page to select input capture option/audio, to make sure it doesn't blindly select the default option when the sources aren't temporary available when opening the settings.
Add simple video cutting in the ui.
Keep replay turned on when opening a fullscreen application and alt-tabbing. Only stop replay when closing the application (when closing all fullscreen applications).
When alt-tabbing check if the previously fullscreen window still exists.

View File

@@ -252,7 +252,9 @@ namespace gsr {
std::unique_ptr<GlobalHotkeys> global_hotkeys = nullptr;
std::unique_ptr<GlobalHotkeysJoystick> global_hotkeys_js = nullptr;
Display *x11_dpy = nullptr;
XEvent x11_mapping_xev;
XEvent x11_xev;
Atom net_active_window_atom;
bool update_focused_window = true;
struct wl_display *wayland_dpy = nullptr;

View File

@@ -518,10 +518,13 @@ namespace gsr {
global_hotkeys_js = register_joystick_hotkeys(this);
x11_dpy = XOpenDisplay(nullptr);
if(x11_dpy)
if(x11_dpy) {
net_active_window_atom = XInternAtom(x11_dpy, "_NET_ACTIVE_WINDOW", False);
XSelectInput(x11_dpy, DefaultRootWindow(x11_dpy), PropertyChangeMask);
XKeysymToKeycode(x11_dpy, XK_F1); // If we dont call we will never get a MappingNotify
else
} else {
fprintf(stderr, "Warning: XOpenDisplay failed to mapping notify\n");
}
if(this->gsr_info.system_info.display_server == DisplayServer::X11) {
cursor_tracker = std::make_unique<CursorTrackerX11>((Display*)mgl_get_context()->connection);
@@ -732,15 +735,28 @@ namespace gsr {
bool mapping_updated = false;
while(XPending(x11_dpy)) {
XNextEvent(x11_dpy, &x11_mapping_xev);
if(x11_mapping_xev.type == MappingNotify) {
XRefreshKeyboardMapping(&x11_mapping_xev.xmapping);
XNextEvent(x11_dpy, &x11_xev);
switch(x11_xev.type) {
case MappingNotify: {
XRefreshKeyboardMapping(&x11_xev.xmapping);
mapping_updated = true;
break;
}
case PropertyNotify: {
if(x11_xev.xproperty.state == PropertyNewValue && x11_xev.xproperty.atom == net_active_window_atom) {
update_focused_window = true;
}
break;
}
}
}
if(mapping_updated)
rebind_all_keyboard_hotkeys();
if(update_focused_window) {
update_focused_window = false;
}
}
void Overlay::handle_events() {

View File

@@ -459,6 +459,7 @@ namespace gsr {
list_ptr->add_widget(create_screenshot_hotkey_options());
list_ptr->add_widget(create_screenshot_region_hotkey_options());
list_ptr->add_widget(create_screenshot_window_hotkey_options());
list_ptr->add_widget(std::make_unique<Label>(&get_theme().body_font, TR("Press ESC to go back to the previous page/close the UI."), get_color_theme().text_color));
list_ptr->add_widget(create_hotkey_control_buttons());
return subsection;
}

View File

@@ -155,6 +155,7 @@ Start/stop recording with desktop portal:=Iniciar/detener grabación con portal
Take a screenshot with desktop portal:=Tomar una captura de pantalla con portal de escritorio
Start/stop recording a window:=Iniciar/detener grabación de una ventana
Take a screenshot of a window:=Tomar una captura de pantalla de una ventana
Press ESC to go back to the previous page/close the UI.=Pulse ESC para volver a la página anterior/cerrar la interfaz de usuario.
Clear hotkeys=Borrar teclas de acceso rápido
Reset hotkeys to default=Reestablecer teclas de acceso rápido a los valores predeterminados

View File

@@ -168,6 +168,7 @@ Start/stop recording with desktop portal:=Lancer/arrêter lenregistrement via
Take a screenshot with desktop portal:=Prendre une capture via le portail du bureau
Start/stop recording a window:=Lancer/arrêter lenregistrement dune fenêtre
Take a screenshot of a window:=Prendre une capture décran dune fenêtre
Press ESC to go back to the previous page/close the UI.=Appuyez sur ÉCHAP pour revenir à la page précédente/fermer l'interface utilisateur.
Clear hotkeys=Effacer les raccourcis
Reset hotkeys to default=Réinitialiser les raccourcis par défaut

View File

@@ -160,6 +160,7 @@ Start/stop recording with desktop portal:=Felvétel indítása/leállítása asz
Take a screenshot with desktop portal:=Képernyőkép készítése asztali portállal:
Start/stop recording a window:=Ablak felvételének indítása/leállítása:
Take a screenshot of a window:=Képernyőkép készítése ablakról:
Press ESC to go back to the previous page/close the UI.=Az előző oldalra való visszatéréshez/a felhasználói felület bezárásához nyomja meg az ESC billentyűt.
Clear hotkeys=Gyorsbillentyűk törlése
Reset hotkeys to default=Gyorsbillentyűk visszaállítása alapértelmezettre

View File

@@ -158,6 +158,7 @@ Start/stop recording with desktop portal:=Запись через портал:
Take a screenshot with desktop portal:=Сделать снимок через портал рабочего стола:
Start/stop recording a window:=Начать/остановить запись окна:
Take a screenshot of a window:=Сделать снимок окна:
Press ESC to go back to the previous page/close the UI.=Нажмите ESC, чтобы вернуться на предыдущую страницу/закрыть интерфейс.
Clear hotkeys=Очистить горячие клавиши
Reset hotkeys to default=Сбросить горячие клавиши по умолчанию

View File

@@ -171,6 +171,7 @@ Start/stop recording with desktop portal:=
Take a screenshot with desktop portal:=
Start/stop recording a window:=
Take a screenshot of a window:=
Press ESC to go back to the previous page/close the UI.=
Clear hotkeys=
Reset hotkeys to default=

View File

@@ -158,6 +158,7 @@ Start/stop recording with desktop portal:=Запис через портал:
Take a screenshot with desktop portal:=Зробити знімок через портал робочого стола:
Start/stop recording a window:=Розпочати/зупинити запис вікна:
Take a screenshot of a window:=Зробити знімок вікна:
Press ESC to go back to the previous page/close the UI.=Натисніть ESC, щоб повернутися на попередню сторінку/закрити інтерфейс користувача.
Clear hotkeys=Очистити гарячі клавіші
Reset hotkeys to default=Скинути гарячі клавіші за замовчуванням