From 2aa15db21035fbedf3d278376f6cf4c92c8ebe3d Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 24 Jan 2018 09:56:42 +0100 Subject: [PATCH] Add shortcut to resize to ratio 1:1 Make Ctrl+g resize the window to the size of the video (pixel-perfect). --- app/src/scrcpy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 84331cf8..0586d515 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -275,6 +275,12 @@ static void handle_key(const SDL_KeyboardEvent *event) { return; } + // Ctrl+g: pixel-perfect (ratio 1:1) + if (keycode == SDLK_g && !shift) { + SDL_SetWindowSize(window, frame_size.width, frame_size.height); + return; + } + // Ctrl+f: switch fullscreen if (keycode == SDLK_f && !shift) { Uint32 new_mode = fullscreen ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP;