Skip to content

Commit dcde578

Browse files
committed
Reactivate "turn device screen on" feature
This reverts commit 8c8649c. 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.
1 parent 93a5c51 commit dcde578

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ Also see [issue #14].
576576
| Click on `POWER` | `Ctrl`+`p` | `Cmd`+`p`
577577
| Power on | _Right-click²_ | _Right-click²_
578578
| Turn device screen off (keep mirroring) | `Ctrl`+`o` | `Cmd`+`o`
579+
| Turn device screen on | `Ctrl`+`Shift`+`o` | `Cmd`+`Shift`+`o`
579580
| Rotate device screen | `Ctrl`+`r` | `Cmd`+`r`
580581
| Expand notification panel | `Ctrl`+`n` | `Cmd`+`n`
581582
| Collapse notification panel | `Ctrl`+`Shift`+`n` | `Cmd`+`Shift`+`n`

app/scrcpy.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ Turn screen on
259259
.B Ctrl+o
260260
Turn device screen off (keep mirroring)
261261

262+
.TP
263+
.B Ctrl+Shift+o
264+
Turn device screen on
265+
262266
.TP
263267
.B Ctrl+r
264268
Rotate device screen

app/src/cli.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ scrcpy_print_usage(const char *arg0) {
231231
" " CTRL_OR_CMD "+o\n"
232232
" Turn device screen off (keep mirroring)\n"
233233
"\n"
234+
" " CTRL_OR_CMD "+Shift+o\n"
235+
" Turn device screen on\n"
236+
"\n"
234237
" " CTRL_OR_CMD "+r\n"
235238
" Rotate device screen\n"
236239
"\n"

app/src/input_manager.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ input_manager_process_key(struct input_manager *im,
321321
}
322322
return;
323323
case SDLK_o:
324-
if (control && cmd && !shift && down) {
325-
set_screen_power_mode(controller, SCREEN_POWER_MODE_OFF);
324+
if (control && cmd && down) {
325+
enum screen_power_mode mode = shift
326+
? SCREEN_POWER_MODE_NORMAL
327+
: SCREEN_POWER_MODE_OFF;
328+
set_screen_power_mode(controller, mode);
326329
}
327330
return;
328331
case SDLK_DOWN:

0 commit comments

Comments
 (0)