Skip to content
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

Add new keyboard input emulation mode based on clipboard #3027

Open
1 task done
devnoname120 opened this issue Feb 16, 2022 · 11 comments
Open
1 task done

Add new keyboard input emulation mode based on clipboard #3027

devnoname120 opened this issue Feb 16, 2022 · 11 comments

Comments

@devnoname120
Copy link

devnoname120 commented Feb 16, 2022

Is your feature request related to a problem? Please describe.

I use a custom keyboard layout on my Mac. Some characters are UTF-8 and so I can't input them. This is an inconvenience because these characters are required to type proper French.

Describe the solution you'd like

Add a keyboard emulation that uses the clipboard. You could paste a single character every time I press a key on my keyboard. This would help support all the characters seamlessly.

Describe alternatives you've considered

I can't use --hid-keyboard because I'm not running Linux.

Additional context
N/A.

@devnoname120 devnoname120 changed the title Add new keyboard input mode based on paste emulation Add new keyboard input emulation mode based on clipboard Feb 16, 2022
@rom1v
Copy link
Collaborator

rom1v commented Feb 16, 2022

This is an inconvenience because these characters are required to type proper French.

Note that French characters are properly input via scrcpy --prefer-text (see text injection preference).

Add a keyboard emulation that uses the clipboard.

I already tried: #1426
But globally, that's a failure, too many quirks.

I can't use --hid-keyboard because I'm not running Linux.

FYI, on Windows, it will not work while mirroring (while adb is enabled), but it will work with --otg (#3011).

And on macOS, it will work in a future release, there is just a remaining bug in SDL which prevents HID mouse to work properly (libsdl-org/SDL#5340).

@devnoname120
Copy link
Author

devnoname120 commented Feb 17, 2022

Thank you for your reply!

I remember trying --prefer-text. It didn't work properly, but I can't recall why. I'll try again and report back.

@devnoname120
Copy link
Author

@rom1v I can't input « using --prefer-text. Any ideas if this would be possible ?

❯ scrcpy --turn-screen-off --stay-awake --prefer-text
scrcpy 1.22 <https://github.com/Genymobile/scrcpy>
/opt/homebrew/Cellar/scrcpy/1.22_1/sha...ped. 56.3 MB/s (40955 bytes in 0.001s)
[server] INFO: Device: Xiaomi Mi Note 10 Lite (Android 11)
2022-02-18 17:37:09.989 scrcpy[56486:741333] INFO: Renderer: metal
2022-02-18 17:37:10.007 scrcpy[56486:741333] INFO: Initial texture: 1080x2336
[server] INFO: Device screen turned off
[server] WARN: Could not inject char u+00ab
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00ab
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00ab
[server] WARN: Could not inject char u+00bb
[server] WARN: Could not inject char u+00a0
[server] WARN: Could not inject char u+00a0
[server] WARN: Could not inject char u+202f

@rom1v
Copy link
Collaborator

rom1v commented Feb 18, 2022

If you change your Android keyboard, does it work?

@devnoname120
Copy link
Author

@rom1v Which keyboard would you recommend me to use? I currently use Gboard.

@devnoname120
Copy link
Author

@rom1v Friendly bump. 🙇‍♂️

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2022

I don't know, it should work with Gboard. You could also try OpenBoard or Simple Keyboard (in F-droid).

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2022

I can't input « using --prefer-text. Any ideas if this would be possible ?

Oh, for « that's expected. Only ASCII and some accented characters could be injected: https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-accented-characters

@devnoname120
Copy link
Author

devnoname120 commented Mar 9, 2022

@rom1v Thanks. I can confirm that AirDroid uses paste emulation and I haven't had any issues using it (except that it's commercial and screen streaming is very laggy). What kind of quirks does it have?

The main downside of using the HID method (apart from the fact it's not available yet on macOS) is that it requires me to port QWERTY-fr to Android. I'm not sure that configuring custom dead keys is possible at all on Android so this is a significant issue for advanced usage.

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2022

(apart from the fact it's not available yet on macOS)

It is available since v1.23: https://github.com/Genymobile/scrcpy/releases/tag/v1.23

@devnoname120
Copy link
Author

devnoname120 commented Mar 9, 2022

@rom1v Awesome! I just need to port QWERTY-fr to Android, and it will be mostly okay (without proper dead keys support though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants