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 an option to disable the on-screen keyboard temporarily #181

Closed
vshymanskyy opened this issue Jun 22, 2018 · 13 comments
Closed

Add an option to disable the on-screen keyboard temporarily #181

vshymanskyy opened this issue Jun 22, 2018 · 13 comments

Comments

@vshymanskyy
Copy link

vshymanskyy commented Jun 22, 2018

I did a small investigation of how it can be done using ADB with a great success.
First, I installed NULL keyboard. A keyboard that does nothing. Yes, really.
It works great, but once I set IME to Null, I can't switch back easily (only through Android settings menu).

IME switching can be done using ADB:

List all IME:

> adb shell ime list -s -a
com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
org.pocketworkstation.pckeyboard/.LatinIME
com.wparam.nullkeyboard/.NullKeyboard

Get current IME:

> adb shell settings get secure default_input_method
org.pocketworkstation.pckeyboard/.LatinIME

Set Null IME:

> adb shell ime set com.wparam.nullkeyboard/.NullKeyboard      
Input method com.wparam.nullkeyboard/.NullKeyboard selected

Restore IME:

> adb shell ime set org.pocketworkstation.pckeyboard/.LatinIME 
Input method org.pocketworkstation.pckeyboard/.LatinIME selected
@rom1v
Copy link
Collaborator

rom1v commented Jun 22, 2018

@vshymanskyy
Copy link
Author

vshymanskyy commented Jun 22, 2018

well yes but i wonder how to combine those custom scripts when needed.
I already created something like:
https://gist.github.com/vshymanskyy/a44ff7af2848653e91f269910cb9d50f

... and it works just f*cking awesome!

@rom1v
Copy link
Collaborator

rom1v commented Jun 22, 2018

👍

adb shell content insert --uri content://settings/system --bind name:s:show_touches --bind value:i:0

Could be replaced by the higher-level command:

adb shell settings put system show_touches 0

@p1ho
Copy link

p1ho commented Mar 7, 2019

This solution works awesome!

@sharunkumar
Copy link

well yes but i wonder how to combine those custom scripts when needed.
I already created something like:
https://gist.github.com/vshymanskyy/a44ff7af2848653e91f269910cb9d50f

... and it works just f*cking awesome!

here's a windows batch script based on your script: https://gist.github.com/sharunkumar/ca2cd57936e4bac974578d1e8a6b3cf6

@intgr
Copy link
Contributor

intgr commented Mar 3, 2021

The downside of a wrapper script is that when I disconnect my phone without closing scrcpy manually, it won't have a chance to restore the keyboard.

@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

scrcpy --hid-keyboard (on dev branch) allows to simulate a physical keyboard, and the virtual keyboard is disabled (it can be enabled from Android settings if necessary).

@rom1v rom1v closed this as completed Oct 27, 2021
@Peter-maximus
Copy link

Peter-maximus commented Oct 28, 2021 via email

@rom1v
Copy link
Collaborator

rom1v commented Oct 28, 2021

@Peter-maximus Yes, on Linux.
#37 (comment)

@Peter-maximus
Copy link

Peter-maximus commented Oct 28, 2021 via email

@rom1v
Copy link
Collaborator

rom1v commented Oct 28, 2021

If someone manages to make it work on Windows (and mocOS)… See discussion.

On Linux, it just works.

@strazto
Copy link

strazto commented May 15, 2022

The workaround posted by @vshymanskyy is clever, but with all of the already discussed.

Also, the app "null keyboard" has been removed from the store.

There is a new app "No Keyboard" which gives us pretty much everything we want, but leaves only a small bar with a keyboard switcher shortcut - For me, it's preferable to a workaround as we don't have to mess with scripts, and also there's no awkward process of restoring our settings if we don't exit cleanly.

image

https://play.google.com/store/apps/details?id=io.github.visnkmr.nokeyboard&hl=en&gl=US

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

7 participants