desktop: Add fullscreen exit keyboard shortcut
Flash Player also exits fullscreen when escape is pressed.
This commit is contained in:
parent
030ff398ef
commit
b2867aa3b9
|
@ -366,6 +366,17 @@ fn run_player(opt: Opt) -> Result<(), Box<dyn std::error::Error>> {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue