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

Espanso doesn't properly work with scrcpy #3228

Open
2 tasks done
Deziminatix opened this issue Apr 28, 2022 · 4 comments
Open
2 tasks done

Espanso doesn't properly work with scrcpy #3228

Deziminatix opened this issue Apr 28, 2022 · 4 comments

Comments

@Deziminatix
Copy link

Deziminatix commented Apr 28, 2022

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Windows 10
  • scrcpy version: 1.21
  • installation method: Windows release
  • device model: Xiaomi Mi A3
  • Android version: 11

Describe the bug
When I use Espanso (a text expander is a program that detects when you type a specific keyword and replaces it with something else) (https://github.com/federico-terzi/espanso) on my real android phone using scrcpy. So when I try to use the Espanso the trigger doesn't expand the phrase.

-trigger: "aaa"
replace: "Hello world!? test test@@ bla bla**"

  1. In scrcpy I try to send messages in Snapchat (left window, watch the attached video) it doesn't expand the text but only symbols
  2. In BlueStacks emulator it works good (right window, watch the attached video)
  3. Also Espanso works good when I just use it on PC in any place. The problem is only with scrcpy

The video: https://user-images.githubusercontent.com/13819963/165863100-2342fc5f-aa8f-47af-83b6-da5a12b28fea.mp4

On errors, please provide the output of the console (and adb logcat if relevant).

Please paste terminal output in a code block. - Can't paste the full log because it's too long...
@Deziminatix Deziminatix changed the title Espanso doesn't work with scrcpy Espanso doesn't properly work with scrcpy Apr 28, 2022
@rom1v
Copy link
Collaborator

rom1v commented Apr 28, 2022

When I use Espanso (a text expander is a program that detects when you type a specific keyword and replaces it with something else) (https://github.com/federico-terzi/espanso) on my real android phone using scrcpy.

Espanso runs on the computer, correct?

Several tests you could do:

  • run scrcpy --prefer-text to inject text instead of key events for letters
  • run scrcpy -Vverbose, type the trigger (aaa) exactly once, then close, and post the console output
  • run in OTG mode scrcpy --otg: is the text replaced?

@Deziminatix
Copy link
Author

Deziminatix commented Apr 29, 2022

Did what you said. Plus I also added some emojis because they also don't get expanded (forgot to mention it earlier).
So here's the same text but with some emojis: Hello world!?😉 test test@@ bla bla😄**
Also, the trigger letters don't get removed (but they have to) after text expands:
image

C:\Users\yarak>scrcpy -Vverbose --prefer-text
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)          01c794fbf4ab            device  Mi_A3
DEBUG: Device serial: 01c794fbf4ab
DEBUG: Using server (portable): C:\Users\yarak\AppData\Local\Android\Sdk\platform-tools\scrcpy-server
C:\Users\yarak\AppData\Local\Android\Sdk\platform-tools\sc... file pushed, 0 skipped. 55.0 MB/s (41159 bytes in 0.001s)
[server] INFO: Device: Xiaomi Mi A3 (Android 11)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'
INFO: Renderer: direct3d
DEBUG: Trilinear filtering disabled (not an OpenGL renderer)
DEBUG: Using icon (portable): C:\Users\yarak\AppData\Local\Android\Sdk\platform-tools\icon.png
INFO: Initial texture: 720x1560
DEBUG: Starting demuxer thread
VERBOSE: input: touch [id=mouse] down position=124,656 pressure= buttons=000000
VERBOSE: input: touch [id=mouse]   up position=124,656 pressure= buttons=000000
VERBOSE: input: key down code=113 repeat=0 meta=203000
VERBOSE: input: key down code=29 repeat=0 meta=203000
VERBOSE: input: key   up code=29 repeat=0 meta=203000
VERBOSE: input: key   up code=113 repeat=0 meta=200000
VERBOSE: input: text "a"
VERBOSE: input: text "a"
VERBOSE: input: text "a"
VERBOSE: input: text "H"
VERBOSE: input: text "e"
VERBOSE: input: text "l"
VERBOSE: input: text "l"
VERBOSE: input: text "o"
VERBOSE: input: text " "
VERBOSE: input: text "w"
VERBOSE: input: text "o"
VERBOSE: input: text "r"
VERBOSE: input: text "l"
VERBOSE: input: text "d"
VERBOSE: input: text "!"
VERBOSE: input: text "?"
VERBOSE: input: text "😉"
VERBOSE: input: text " "
VERBOSE: input: text "t"
VERBOSE: input: text "e"
VERBOSE: input: text "s"
VERBOSE: input: text "t"
VERBOSE: input: text " "
VERBOSE: input: text "t"
VERBOSE: input: text "e"
VERBOSE: input: text "s"
VERBOSE: input: text "t"
VERBOSE: input: text "@"
[server] WARN: Could not inject char u+d83dVERBOSE: input: text "@"
VERBOSE: input: text " "
VERBOSE: input: text "b"

VERBOSE: input: text "l"
VERBOSE: input: text "a"
[server] WARN: Could not inject char u+de09VERBOSE: input: text " "

VERBOSE: input: text "b"
VERBOSE: input: text "l"
VERBOSE: input: text "a"
VERBOSE: input: text "😄"
VERBOSE: input: text "*"
VERBOSE: input: text "*"
[server] WARN: Could not inject char u+d83d
[server] WARN: Could not inject char u+de04

Also, I tried running in OTG mode but something is wrong with it. After I ran that command it started giving me those errors when I move my mouse and it locked the mouse so I couldn't do anything. To exit from that mode I had to press Win button.
image

@Deziminatix
Copy link
Author

When I use Espanso (a text expander is a program that detects when you type a specific keyword and replaces it with something else) (https://github.com/federico-terzi/espanso) on my real android phone using scrcpy.

Espanso runs on the computer, correct?

Several tests you could do:

  • run scrcpy --prefer-text to inject text instead of key events for letters
  • run scrcpy -Vverbose, type the trigger (aaa) exactly once, then close, and post the console output
  • run in OTG mode scrcpy --otg: is the text replaced?

For some reason, I couldn't quote your reply. So just letting you know I replied to you.

@rom1v
Copy link
Collaborator

rom1v commented Apr 29, 2022

Plus I also added some emojis because they also don't get expanded (forgot to mention it earlier).

That's "expected": https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#special-characters-do-not-work

Also, the trigger letters don't get removed (but they have to) after text expands:

I don't know what "Espanso" does to remove the characters, but it seems nothing is received by SDL. Maybe try with an older SDL version (refs #3230).

After I ran that command it started giving me those errors when I move my mouse

Do you have a "gaming" mouse? (see #3088)

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