Accept Super as shortcut modifier

In addition to (left) Alt, also accept (left) Super. This is especially
convenient for macOS users (Super is the Cmd key).
This commit is contained in:
Romain Vimont 2020-07-17 00:00:42 +02:00
parent 1b76d9fd78
commit e4bb7c1d1f
4 changed files with 8 additions and 7 deletions

View file

@ -572,7 +572,7 @@ Also see [issue #14].
## Shortcuts ## Shortcuts
In the following list, `MOD` is the shortcut modifier. By default, it's (left) In the following list, `MOD` is the shortcut modifier. By default, it's (left)
`Alt`. `Alt` or (left) `Super`.
It can be changed using `--shortcut-mod`. Possible keys are `lctrl`, `rctrl`, It can be changed using `--shortcut-mod`. Possible keys are `lctrl`, `rctrl`,
`lalt`, `ralt`, `lsuper` and `rsuper`. For example: `lalt`, `ralt`, `lsuper` and `rsuper`. For example:

View file

@ -157,7 +157,7 @@ A shortcut can consist in several keys, separated by '+'. Several shortcuts can
For example, to use either LCtrl+LAlt or LSuper for scrcpy shortcuts, pass "lctrl+lalt,lsuper". For example, to use either LCtrl+LAlt or LSuper for scrcpy shortcuts, pass "lctrl+lalt,lsuper".
Default is "lalt" (left-Alt). Default is "lalt,lsuper" (left-Alt or left-Super).
.TP .TP
.B \-S, \-\-turn\-screen\-off .B \-S, \-\-turn\-screen\-off
@ -218,7 +218,7 @@ Default is 0 (automatic).\n
.SH SHORTCUTS .SH SHORTCUTS
In the following list, MOD is the shortcut modifier. By default, it's (left) In the following list, MOD is the shortcut modifier. By default, it's (left)
Alt, but it can be configured by \-\-shortcut-mod. Alt or (left) Super, but it can be configured by \-\-shortcut-mod.
.TP .TP
.B MOD+f .B MOD+f

View file

@ -149,7 +149,7 @@ scrcpy_print_usage(const char *arg0) {
" For example, to use either LCtrl+LAlt or LSuper for scrcpy\n" " For example, to use either LCtrl+LAlt or LSuper for scrcpy\n"
" shortcuts, pass \"lctrl+lalt,lsuper\".\n" " shortcuts, pass \"lctrl+lalt,lsuper\".\n"
"\n" "\n"
" Default is \"lalt\" (left-Alt).\n" " Default is \"lalt,lsuper\" (left-Alt or left-Super).\n"
"\n" "\n"
" -S, --turn-screen-off\n" " -S, --turn-screen-off\n"
" Turn the device screen off immediately.\n" " Turn the device screen off immediately.\n"
@ -199,7 +199,8 @@ scrcpy_print_usage(const char *arg0) {
"Shortcuts:\n" "Shortcuts:\n"
"\n" "\n"
" In the following list, MOD is the shortcut modifier. By default,\n" " In the following list, MOD is the shortcut modifier. By default,\n"
" it's (left) Alt, but it can be configured by --shortcut-mod.\n" " it's (left) Alt or (left) Super, but it can be configured by\n"
" --shortcut-mod.\n"
"\n" "\n"
" MOD+f\n" " MOD+f\n"
" Switch fullscreen mode\n" " Switch fullscreen mode\n"

View file

@ -95,8 +95,8 @@ struct scrcpy_options {
.last = DEFAULT_LOCAL_PORT_RANGE_LAST, \ .last = DEFAULT_LOCAL_PORT_RANGE_LAST, \
}, \ }, \
.shortcut_mods = { \ .shortcut_mods = { \
.data = {SC_MOD_LALT}, \ .data = {SC_MOD_LALT, SC_MOD_LSUPER}, \
.count = 1, \ .count = 2, \
}, \ }, \
.max_size = DEFAULT_MAX_SIZE, \ .max_size = DEFAULT_MAX_SIZE, \
.bit_rate = DEFAULT_BIT_RATE, \ .bit_rate = DEFAULT_BIT_RATE, \