Skip to content

Commit

Permalink
Replace Ctrl by Meta for volume shortcuts on MacOS
Browse files Browse the repository at this point in the history
Ctrl+UP and Ctrl+DOWN are already used by the window manager on MacOS.

Use Cmd key instead (like on VLC).
  • Loading branch information
rom1v committed Nov 1, 2018
1 parent 5bf1261 commit d061c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ scrcpy -f
| click on `BACK` | `Ctrl`+`b` \| _Right-click²_ |
| click on `APP_SWITCH` | `Ctrl`+`s` |
| click on `MENU` | `Ctrl`+`m` |
| click on `VOLUME_UP` | `Ctrl`+`` _(up)_ |
| click on `VOLUME_DOWN` | `Ctrl`+`` _(down)_ |
| click on `VOLUME_UP` | `Ctrl`+`` _(up)_ (`Cmd`+`` on MacOS) |
| click on `VOLUME_DOWN` | `Ctrl`+`` _(down)_ (`Cmd`+`` on MacOS) |
| click on `POWER` | `Ctrl`+`p` |
| turn screen on | _Right-click²_ |
| paste computer clipboard to device | `Ctrl`+`v` |
Expand Down
8 changes: 8 additions & 0 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,21 @@ void input_manager_process_key(struct input_manager *input_manager,
}
return;
case SDLK_DOWN:
#ifdef __APPLE__
if (!ctrl && meta) {
#else
if (ctrl && !meta) {
#endif
// forward repeated events
action_volume_down(input_manager->controller, action);
}
return;
case SDLK_UP:
#ifdef __APPLE__
if (!ctrl && meta) {
#else
if (ctrl && !meta) {
#endif
// forward repeated events
action_volume_up(input_manager->controller, action);
}
Expand Down

0 comments on commit d061c30

Please sign in to comment.