mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 11:35:57 +00:00
Forward LCtrl to the device
Now that only RCtrl is used for scrcpy shortcuts, LCtrl can be forwarded to the device. This allows to trigger Android shortcuts. Fixes #555 <https://github.com/Genymobile/scrcpy/issues/555>
This commit is contained in:
parent
fbd2d0bf3e
commit
e62aca59fe
2 changed files with 5 additions and 5 deletions
|
@ -92,6 +92,7 @@ convert_keycode(SDL_Keycode from, enum android_keycode *to, uint16_t mod,
|
|||
MAP(SDLK_LEFT, AKEYCODE_DPAD_LEFT);
|
||||
MAP(SDLK_DOWN, AKEYCODE_DPAD_DOWN);
|
||||
MAP(SDLK_UP, AKEYCODE_DPAD_UP);
|
||||
MAP(SDLK_LCTRL, AKEYCODE_CTRL_LEFT);
|
||||
}
|
||||
|
||||
if (!(mod & (KMOD_NUM | KMOD_SHIFT))) {
|
||||
|
@ -111,7 +112,7 @@ convert_keycode(SDL_Keycode from, enum android_keycode *to, uint16_t mod,
|
|||
}
|
||||
}
|
||||
|
||||
if (prefer_text) {
|
||||
if (prefer_text && !(mod & KMOD_LCTRL)) {
|
||||
// do not forward alpha and space key events
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -259,14 +259,13 @@ input_manager_process_key(struct input_manager *im,
|
|||
// control: indicates the state of the command-line option --no-control
|
||||
// ctrl: the Ctrl key
|
||||
|
||||
bool lctrl = event->keysym.mod & KMOD_LCTRL;
|
||||
bool rctrl = event->keysym.mod & KMOD_RCTRL;
|
||||
bool alt = event->keysym.mod & (KMOD_LALT | KMOD_RALT);
|
||||
bool meta = event->keysym.mod & (KMOD_LGUI | KMOD_RGUI);
|
||||
|
||||
if (alt || lctrl || meta) {
|
||||
// No shortcuts involve Alt, Meta or LCtrl, and they are not forwarded
|
||||
// to the device
|
||||
if (alt || meta) {
|
||||
// No shortcuts involve Alt or Meta, and they are not forwarded to the
|
||||
// device
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue