From 82a053015d01d3a1e1b6f60fbe6c0cd6910dc344 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 26 Nov 2021 21:19:39 +0100 Subject: [PATCH] Improve HID keyboard documentation Explain how to configure the keyboard layout. --- README.md | 9 +++++++++ app/scrcpy.1 | 6 ++++++ app/src/cli.c | 9 ++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef9fcc98..3e167b06 100644 --- a/README.md +++ b/README.md @@ -803,6 +803,15 @@ of the host key mapping. Therefore, if your keyboard layout does not match, it must be configured on the Android device, in Settings → System → Languages and input → [Physical keyboard]. +This settings page can be started directly: + +```bash +adb shell am start -a android.settings.HARD_KEYBOARD_SETTINGS +``` + +However, the option is only available when the HID keyboard is enabled (or when +a physical keyboard is connected). + [Physical keyboard]: https://github.com/Genymobile/scrcpy/pull/2632#issuecomment-923756915 diff --git a/app/scrcpy.1 b/app/scrcpy.1 index 715000b6..f7508d5e 100644 --- a/app/scrcpy.1 +++ b/app/scrcpy.1 @@ -90,6 +90,12 @@ This provides a better experience for IME users, and allows to generate non-ASCI It may only work over USB, and is currently only supported on Linux. +The keyboard layout must be configured (once and for all) on the device, via Settings -> System -> Languages and input -> Physical keyboard. This settings page can be started directly: + + adb shell am start -a android.settings.HARD_KEYBOARD_SETTINGS + +However, the option is only available when the HID keyboard is enabled (or a physical keyboard is connected). + .TP .B \-\-legacy\-paste Inject computer clipboard text as a sequence of key events on Ctrl+v (like MOD+Shift+v). diff --git a/app/src/cli.c b/app/src/cli.c index 8cfaf57b..410ce25a 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -165,7 +165,14 @@ static const struct sc_option options[] = { "generate non-ASCII characters, contrary to the default " "injection method.\n" "It may only work over USB, and is currently only supported " - "on Linux.", + "on Linux.\n" + "The keyboard layout must be configured (once and for all) on " + "the device, via Settings -> System -> Languages and input -> " + "Physical keyboard. This settings page can be started " + "directly: `adb shell am start -a " + "android.settings.HARD_KEYBOARD_SETTINGS`.\n" + "However, the option is only available when the HID keyboard " + "is enabled (or a physical keyboard is connected).", }, { .shortopt = 'h',