From b2867aa3b98f4b66d6cb3a7d61cd6d91e6713c22 Mon Sep 17 00:00:00 2001 From: relrelb Date: Fri, 8 Jan 2021 11:00:25 +0200 Subject: [PATCH] desktop: Add fullscreen exit keyboard shortcut Flash Player also exits fullscreen when escape is pressed. --- desktop/src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/desktop/src/main.rs b/desktop/src/main.rs index bfc265aef..81a2f3806 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -366,6 +366,17 @@ fn run_player(opt: Opt) -> Result<(), Box> { Some(_) => None, }); } + WindowEvent::KeyboardInput { + input: + KeyboardInput { + state: ElementState::Pressed, + virtual_keycode: Some(VirtualKeyCode::Escape), + .. + }, + .. + } => { + window.set_fullscreen(None); + } WindowEvent::KeyboardInput { .. } | WindowEvent::ReceivedCharacter(_) => { let mut player_lock = player.lock().unwrap(); if let Some(event) = player_lock