From dcde578a50ffb9d2594c4764a067e9dd328bf55c Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 27 May 2020 18:18:39 +0200 Subject: [PATCH] Reactivate "turn device screen on" feature This reverts commit 8c8649cfcd710859ce18eab557ed2af8cedb9a42. I cannot reproduce the issue with Ctrl+Shift+o on any device, so in practice it works, it's too bad to remove the feature for a random bug on some Android versions on some devices. --- README.md | 1 + app/scrcpy.1 | 4 ++++ app/src/cli.c | 3 +++ app/src/input_manager.c | 7 +++++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cc7e1fd..fe4c8584 100644 --- a/README.md +++ b/README.md @@ -576,6 +576,7 @@ Also see [issue #14]. | Click on `POWER` | `Ctrl`+`p` | `Cmd`+`p` | Power on | _Right-click²_ | _Right-click²_ | Turn device screen off (keep mirroring) | `Ctrl`+`o` | `Cmd`+`o` + | Turn device screen on | `Ctrl`+`Shift`+`o` | `Cmd`+`Shift`+`o` | Rotate device screen | `Ctrl`+`r` | `Cmd`+`r` | Expand notification panel | `Ctrl`+`n` | `Cmd`+`n` | Collapse notification panel | `Ctrl`+`Shift`+`n` | `Cmd`+`Shift`+`n` diff --git a/app/scrcpy.1 b/app/scrcpy.1 index e5568849..de4a70e4 100644 --- a/app/scrcpy.1 +++ b/app/scrcpy.1 @@ -259,6 +259,10 @@ Turn screen on .B Ctrl+o Turn device screen off (keep mirroring) +.TP +.B Ctrl+Shift+o +Turn device screen on + .TP .B Ctrl+r Rotate device screen diff --git a/app/src/cli.c b/app/src/cli.c index 836edc30..0be1bd75 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -231,6 +231,9 @@ scrcpy_print_usage(const char *arg0) { " " CTRL_OR_CMD "+o\n" " Turn device screen off (keep mirroring)\n" "\n" + " " CTRL_OR_CMD "+Shift+o\n" + " Turn device screen on\n" + "\n" " " CTRL_OR_CMD "+r\n" " Rotate device screen\n" "\n" diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 3cb9e3ac..e8ba9f79 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -321,8 +321,11 @@ input_manager_process_key(struct input_manager *im, } return; case SDLK_o: - if (control && cmd && !shift && down) { - set_screen_power_mode(controller, SCREEN_POWER_MODE_OFF); + if (control && cmd && down) { + enum screen_power_mode mode = shift + ? SCREEN_POWER_MODE_NORMAL + : SCREEN_POWER_MODE_OFF; + set_screen_power_mode(controller, mode); } return; case SDLK_DOWN: