Skip to content

Commit

Permalink
Reactivate "turn device screen on" feature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rom1v committed May 27, 2020
1 parent 93a5c51 commit dcde578
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 4 additions & 0 deletions app/scrcpy.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dcde578

Please sign in to comment.