Skip to content

Commit

Permalink
#828 feat: make it clearer what the Android 11 workaround does
Browse files Browse the repository at this point in the history
  • Loading branch information
sds100 committed Jan 31, 2022
1 parent b592bab commit 23b8584
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,18 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() {
key = Keys.rerouteKeyEvents.name
setDefaultValue(false)

setTitle(R.string.title_pref_devices_to_reroute_keyevents)
setSummary(R.string.summary_pref_devices_to_reroute_keyevents)
setTitle(R.string.title_pref_reroute_keyevents)
isSingleLineTitle = false

category.addPreference(this)
}

Preference(requireContext()).apply {
setSummary(R.string.summary_pref_reroute_keyevents)

category.addPreference(this)
}

Preference(requireContext()).apply {
setTitle(R.string.title_pref_devices_to_reroute_keyevents_guide)
setOnPreferenceClickListener {
Expand Down Expand Up @@ -498,11 +503,9 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() {

viewLifecycleOwner.addRepeatingJob(Lifecycle.State.RESUMED) {
viewModel.rerouteKeyEvents.collectLatest { enabled ->
for (i in 0 until category.preferenceCount) {
for (i in 2 until category.preferenceCount) {
category.getPreference(i).apply {
if (this.key != Keys.rerouteKeyEvents.name) {
this.isVisible = enabled
}
this.isVisible = enabled
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,12 @@
<string name="title_pref_show_device_descriptors">Show the first 5 characters of the device id for device specific triggers</string>
<string name="summary_pref_show_device_descriptors">This is useful to differentiate between devices that have the same name.</string>

<string name="title_pref_devices_to_reroute_keyevents">Workaround for Android 11 bug that sets the device id for input events to -1</string>
<string name="summary_pref_devices_to_reroute_keyevents">Select the devices that Key Mapper should intercept all key events and then reroute through the chosen Key Mapper keyboard. You MUST be using the Key Mapper GUI Keyboard or the Key Mapper Basic Input Method for this to work. This is a partial workaround for https://issuetracker.google.com/issues/163120692. This will NOT work with game controllers.</string>
<string name="title_pref_reroute_keyevents_link">Fix keyboards that are set to US English</string>
<string name="summary_pref_reroute_keyevents_link">This fixes keyboards that don\'t have the correct the keyboard layout when an accessibility service is enabled. Tap to read more and configure.</string>

<string name="title_pref_reroute_keyevents">Fix keyboards that are set to US English</string>
<string name="summary_pref_reroute_keyevents">There is a bug in Android 11 that turning on an accessibility service makes Android think all external devices are the same internal virtual device. Because it can\'t identify these devices correctly, it doesn\'t know which keyboard layout to use with them so it defaults to US English even if it is a German keyboard for example. You can use Key Mapper to work around this problem by following the steps below.</string>

<string name="title_pref_devices_to_reroute_keyevents_choose_devices">4. Choose devices</string>

<string name="title_pref_devices_to_reroute_keyevents_install_gui_keyboard">1. Install the Key Mapper GUI Keyboard (optional)</string>
Expand Down

0 comments on commit 23b8584

Please sign in to comment.