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

can you add keyboard event? #7

Closed
wan766405890 opened this issue Sep 9, 2019 · 7 comments
Closed

can you add keyboard event? #7

wan766405890 opened this issue Sep 9, 2019 · 7 comments

Comments

@wan766405890
Copy link

can you add keyboard event listener,so we can input text by ime!

@drauggres
Copy link
Collaborator

It is not possible to send non-ASCII characters with keyboard events.
Try develop branch. It has clipboard support from scrcpy v1.9 (but some things may be broken).

@wan766405890
Copy link
Author

Original Scrcpy Support Keyboard Event

@drauggres
Copy link
Collaborator

Are you sure? (Genymobile/scrcpy#37 Genymobile/scrcpy#632). Or do you mean something else?

@wan766405890
Copy link
Author

what i mean is input text and cut/paste by keyboard directly! I am sure Scrcpy support it!

@drauggres
Copy link
Collaborator

OK, now I understand what you want. It should be easy to do, but not sure when I could do it.
You can try to implement this yourself, basically you need to:

  1. add listeners for keydown and keyup events
  2. create KeyCodeControlEvent in these listeners
  3. call connection.send(event) with this KeyCodeControlEvent as argument.

Look here for example.

P.S. you know that you can type text into input and when press Send as keys button, right?

@NetrisTV NetrisTV deleted a comment from wan766405890 Sep 26, 2019
@daigaigai520
Copy link

hi, can you update the version?
newest scrcpy version is 1.21.1, and TYPE_INJECT_MOUSE_EVENT has been removed.

@drauggres
Copy link
Collaborator

@daigaigai520 I plan to do it, but no promises. Any help is appreciated and PRs are welcome (scrcpy fork is here).

P.S. Please open separate issues for different problems.

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

3 participants