Leave fullscreen with "Esc" key

This commit is contained in:
Rafostar
2021-07-18 15:34:41 +02:00
parent 5378facb46
commit 1004000ba2
2 changed files with 10 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ var actions = {
change_repeat: ['<Ctrl>r'], change_repeat: ['<Ctrl>r'],
reveal_controls: ['Return'], reveal_controls: ['Return'],
toggle_fullscreen: ['F11', 'f'], toggle_fullscreen: ['F11', 'f'],
leave_fullscreen: ['Escape'],
quit: ['<Ctrl>q', 'q'], quit: ['<Ctrl>q', 'q'],
}; };
@@ -85,6 +86,9 @@ function handleAction(action, window)
if(clapperWidget.isFullscreenMode) if(clapperWidget.isFullscreenMode)
clapperWidget.revealControls(); clapperWidget.revealControls();
break; break;
case 'leave_fullscreen':
if(!clapperWidget.isFullscreenMode)
break;
case 'toggle_fullscreen': case 'toggle_fullscreen':
clapperWidget.toggleFullscreen(); clapperWidget.toggleFullscreen();
break; break;

View File

@@ -20,6 +20,12 @@
<property name="accelerator">F11 f</property> <property name="accelerator">F11 f</property>
</object> </object>
</child> </child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes">Leave fullscreen</property>
<property name="accelerator">Escape</property>
</object>
</child>
<child> <child>
<object class="GtkShortcutsShortcut"> <object class="GtkShortcutsShortcut">
<property name="title" translatable="yes">Reveal OSD (fullscreen only)</property> <property name="title" translatable="yes">Reveal OSD (fullscreen only)</property>