-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forward RCtrl to the device #1446
Conversation
I think most of the users will prefer doing it in the other way (forward left-ctrl and use the right one for srccpy ). |
I prefer the reverse too: left-ctrl passed in, right-ctrl is for srccpy. Virtualbox works this way by default. PS: Ctrl-T in the traditional Firefox for Android works. It doesn't work for Firefox Preview (which lacks a lot of features). |
Scrcpy is entirely controlled by It's good to have a way to send
IIRC, Virtualbox behaves differently: Right-Ctrl is the "host key", to be pressed alone to switch the "capture" mode. Here, it is used to inject shortcuts in the device. |
Scrcpy is entirely controlled by `Ctrl`+key shortcuts, so I think it should use the main `Ctrl` key (left). IMO it would be surprising if scrcpy shortcuts didn't work with left `Ctrl`.
It's good to have a way to send `Ctrl`+shortcuts to the device, but IMO it's secondary compared to scrcpy shortcuts.
Well, maybe. Actually when I use scrcpy I don't even care about
keyboards, partly because native shortcuts are not working well.
I have two reasons to use scrcpy:
1. massive typing scenarios: I connect my keyboard to my phone via USB or bluetooth.
2. read-only view, e.g. as a remote camera.
> Virtualbox works this way by default.
IIRC, Virtualbox behaves differently: Right-Ctrl is the "host key", to be pressed alone to switch the "capture" mode. Here, it is used to inject shortcuts in the device.
In Virtualbox you use right-ctrl to send keys to Virtualbox, not only to toggle "capture" mode.
|
Ok, I didn't know that. 👍
In fact, that's not necessarily true. When However, I'm especially annoyed with copy-paste shortcuts: if left- We could make an exception for these shortcuts (and maybe some others), but it would be very confusing, since In short, if I don't have a good solution for copy-paste, I think I still prefer right- Of course, more opinions on the subject are welcome :) |
Another possibility could be to move all shortcuts from
EDIT: even better, we don't need a scrcpy shortcut to copy clipboard: every copy on the device is now automatically synchronized to the computer clipboard, so forwarding This would also require to change the What do you think? |
To validate the behavior, I just implemented that in a branch:
What is not done yet:
Thank you for your feedbacks 😉 BinariesFor windows users, take both For other platforms, take
|
Oh, it can be simplified: we can synchronize the computer clipboard to the device clipboard any time the user presses That way, we can remove So to summarize:
For now, there is still:
But I think they could be removed. |
The Windows key is usually used for global things of the desktop environment, thus not passing into the application.
But can scrcpy distinguish between a text field and a terminal? What about mouse/touch-initialized copy? What about a tmux-style prefix scheme? Or other schemes that make the key used completely configurable so the user can tweak to avoid conflicts. BTW in Linux a "meta" key means either a key that usually doesn't physically exist, or an Alt key. The Windows key and Command key is called Super. |
Do you have concrete exemples (in addition to Cmd+h and Cmd+m on macOS)? What key would you suggest? Would
In this branch,
If you copy by clicking on COPY on the device, it will change the device clipboard, so it will also be synchronized to the computer clipboard.
It's another possibility, but I think it's too bad to use an shortcut prefix to fullscreen or other stuff, whereas there are other keys available.
👍 I will rename it to |
e.g. I use super+c to close current window with the Awesome window manager (the default was super+shift+c). There is a lot of shortcuts on window managers that put an emphasis on keyboard accessibility.
Alt is only a little better considering a lot of my zsh key bindings. Outside a terminal it should work great (not captured by local global shortcuts, not shadowing Android side keys). I suggest to make it configurable if feasible, e.g. let the user choose what combinations do what.
That's great! |
What do you think about allowing the users to config the key that will be used to control scrcpy, so one can pick the one that match better with his own workflow? So you can use left control as default for backward compatibility. |
You're right, on Windows, I think I will forward left-
In theory, yes, but it's a lot of work: loading the config file at the right location for each platform, define the file format, parse it in C (which is awful for that task), execute the actions depending on the configuration... I have no time to do that, and there are other priorities (for example, when I have more time, I would like to work on audio forwarding). |
This is entirely correct. In Windows 10 Win + R launches Run dialog , Win + D toggles showing the desktop, Win + L locks the screen, Windows+V the clipboard manager and there's plenty other letters already set by default by windows (https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts) so I would forget about that button for a modifier as it is almost 'hardwired' to the windows desktop environment and prone to cause trouble to Windows and Linux users alike as recent Linux DEs also started using them (and personally I also use set that modifier for DE actions).
I support this fashion, in a way akin to how VirtualBox does it. I.e. keeping the underlying program controller keys from interfering with normal expected application interaction. The rational being is that back, home and other scrcpy actions comes second to and occur less often than the actual work on the app a user is interested in doing. |
BTW there are some Win-prefixed keys for Android too, e.g. Win+Enter -> Home screen, Win+Backspace -> Back, Win+N -> Notifications, Win+/ -> show the Keyboard shortcut list (it displays as a search icon, but Win key triggers it). |
I just did that in #1465. Feedback welcome there 😉 |
Some of the company's windows laptops do not have the Rctrl key. What should I do? |
You can use AutoHotKey to bind it to another key |
Here is a new proposal: #1598 |
Only capture Left-Ctrl for scrcpy shortcuts, so that Right-Ctrl can be forwarded to the device.
Fixes #555
This allows for example to press
Ctrl
+t
in Chrome to open a new tab (unfortunately, this shortcut does not work in Firefox) or to pressCtrl
+c
orCtrl
+d
in Termux.What do you think?
scrcpy.exe
SHA256: f07bb80ff82350a4b8d32bc6a00eeb9fc981a9c14bf7815018918dce09adb77c
(to be replaced in v1.14 release)