mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Enable "reset video" shortcut for camera
Make the existing "reset video" feature (MOD+Shift+R) also work for a camera video source.
This commit is contained in:
parent
ac26cac4f7
commit
50d79e758a
2 changed files with 24 additions and 9 deletions
|
|
@ -465,6 +465,19 @@ sc_input_manager_process_key(struct sc_input_manager *im,
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Flatten conditions to avoid additional indentation levels
|
||||
if (control) {
|
||||
// Controls for all sources
|
||||
switch (sdl_keycode) {
|
||||
case SDLK_R:
|
||||
if (!repeat && shift && down && !paused) {
|
||||
reset_video(im);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (control && !im->camera) {
|
||||
switch (sdl_keycode) {
|
||||
case SDLK_H:
|
||||
|
|
@ -545,12 +558,8 @@ sc_input_manager_process_key(struct sc_input_manager *im,
|
|||
}
|
||||
return;
|
||||
case SDLK_R:
|
||||
if (!repeat && down && !paused) {
|
||||
if (shift) {
|
||||
reset_video(im);
|
||||
} else {
|
||||
rotate_device(im);
|
||||
}
|
||||
if (!repeat && !shift && down && !paused) {
|
||||
rotate_device(im);
|
||||
}
|
||||
return;
|
||||
case SDLK_K:
|
||||
|
|
|
|||
|
|
@ -287,6 +287,15 @@ public class Controller implements AsyncProcessor, VirtualDisplayListener {
|
|||
|
||||
int type = msg.getType();
|
||||
|
||||
// Events for all sources (display or camera)
|
||||
switch (type) {
|
||||
case ControlMessage.TYPE_RESET_VIDEO:
|
||||
resetVideo();
|
||||
return true;
|
||||
default:
|
||||
// fall through
|
||||
}
|
||||
|
||||
if (!camera) {
|
||||
switch (type) {
|
||||
case ControlMessage.TYPE_INJECT_KEYCODE:
|
||||
|
|
@ -353,9 +362,6 @@ public class Controller implements AsyncProcessor, VirtualDisplayListener {
|
|||
case ControlMessage.TYPE_START_APP:
|
||||
startAppAsync(msg.getText());
|
||||
return true;
|
||||
case ControlMessage.TYPE_RESET_VIDEO:
|
||||
resetVideo();
|
||||
return true;
|
||||
default:
|
||||
// fall through
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue