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

Hide keyboard while connected, as if with a physical keyboard #767

Closed
fefo-dev opened this issue Aug 30, 2019 · 11 comments
Closed

Hide keyboard while connected, as if with a physical keyboard #767

fefo-dev opened this issue Aug 30, 2019 · 11 comments

Comments

@fefo-dev
Copy link

Hi. Can you make the phone identify scrcpy like a physical keyboard, to disable the software one? I've seen workarounds with scripts and fake-ish keyboard apps but they seem so convoluted, while with physical keyboards the behaviour is pretty consistent - no need for it when you got the real thing. Can you manipulate this 'flag' like that?

Feel free to disregard the feature request if it's a repeat, but I couldn't find anything that outlined this clearly.

@ghost
Copy link

ghost commented Aug 30, 2019

It would also be nice to have a hotkey which makes the cursor inside the scrcpy window serve as an actual mouse to android. Some applications have a better interface for mouse than touch.

@colicrod
Copy link

colicrod commented Sep 6, 2019

Some suggestion: what if you install null keyboard (from app store). It display nothing. Other options the one i'm using now is ADB keyboard. Helps me to send alphanumeric and android commands / shortcut via ADB where scrcpy still needs time to fix the issue.

@srevinsaju
Copy link

srevinsaju commented Sep 6, 2019 via email

@fefo-dev
Copy link
Author

fefo-dev commented Sep 6, 2019

@colicrod I was doing this but it's not the most optimal. Null has the extra issue of needing to dive into settings to enable your soft keyboard again since Android doesn't identify it, by design.

@srevinsaju haven't heard of your solution, I'll test it later.

I'll see how android works when you connect an USB keyboard with an USB-OTG adapter that I found, and report back. If you can send the same info through scrcpy maybe you can trigger this behaviour. However I wonder if when the connection is broken this would be able to revert itself.

@inxomnyaa
Copy link

inxomnyaa commented Dec 10, 2019

Just found this, maybe this can help the development https://github.com/senzhk/ADBKeyBoard. NullKeyboard is my current solution, at least hides it

@fefo-dev
Copy link
Author

I forgot to report my tests with OTG.

Seems that GBoard implemented some features for physical keyboards, and with that a bar to harbor those. Kinda neat, but doesn't help with the clutter issue I had in mind. I didn't test it thoroughtly however.

@maddinmcfly
Copy link

KDE connect seems to be more of an effort than using null keyboard, which btw works great for me.

@Tedxz
Copy link

Tedxz commented Apr 2, 2021

I think simulating a physical keyboard might be the best solution for many non-English users for typing. When a physical keyboard is connected to the phone, the candidate words are shown without the soft keyboard. The number keys can also be used to choose the word.

@Peter-maximus
Copy link

completely agree with having the option to emulate physical keyboard and this way to disable gboard once scrcpy connected to phone...
this way there will be also automatic restore of the original keyboard once usb cable disconnected.
Which unfortunately is not the case if using the workaround script. For that properly working you need firstly close scrcpy and adfterwards disconnect phone...

@rom1v
Copy link
Collaborator

rom1v commented Oct 27, 2021

Closed by #2632.

Refs #37 (comment)

@rom1v rom1v closed this as completed Oct 27, 2021
@IndustrialMuffin
Copy link

IndustrialMuffin commented Feb 17, 2022

When connecting over TCP/IP the --hid-keyboard option won't work, so I do this before starting scrcpy to keep the annoying on-screen keyboard from popping up and covering half the screen:

adb -s 192.168.1.140:5555 shell pm disable-user com.google.android.googlequicksearchbox
adb -s 192.168.1.140:5555 shell pm disable-user com.google.android.inputmethod.latin

The on-screen keyboard was disabled with com.google.android.inputmethod.latin but I also had to disable com.google.android.googlequicksearchbox otherwise it made voice typing the keyboard that would start and cover half the screen.

Then after scrcpy is done, I can re-enable those things, but I'll probably just leave the googlequicksearchbox disabled and uninstall any byte wasting updates to it since I never use it:

adb -s 192.168.1.140:5555 shell pm enable com.google.android.googlequicksearchbox
adb -s 192.168.1.140:5555 shell pm enable com.google.android.inputmethod.latin

Obviously if you do this, for the -s option you'll have to use your device's proper serial (ip address and port.) On other devices and android versions the packages might have other names, or you might have other keyboard related packages to look for. To find what those packages are named, you can look through the list from:

adb -s 192.168.1.140:5555 shell pm list packages

A good starting point would be just to look for packages I disabled, or similarly named packages.

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

No branches or pull requests

9 participants