Skip to content
sds100 edited this page Dec 30, 2020 · 56 revisions

HELP!!! I have no keyboard!!! 😱😱

Don't panic! You still have your normal keyboard on your phone. The keyboard built-in to Key Mapper, which is called the "Key Mapper Basic Input Method", has no GUI/buttons. You can install the Key Mapper GUI Keyboard to get a proper keyboard which can perform Key Mapper actions.

This is why the built-in one isn't a usable keyboard...

I originally made the app so I could map the keys on my Bluetooth keyboard to the correct characters since it was made for an iPad. A limitation of Android is an app can only input characters and keys if it is the SELECTED input method, which is why the Key Mapper keyboard needs to be chosen to use the KeyEvent and Text actions. I didn't design it to have an on-screen keyboard since I would be using the physical keyboard anyway. But after many requests and complaints I will implement the AOSP keyboard into the Key Mapper keyboard. This is also why there are a few settings controlling when to show the keyboard, since I wanted to make switching between the on-screen keyboard and the Key Mapper keyboard as simple as possible.

KeyMapper Permissions

Why don't my volume buttons work when I press them?

Give the app Do Not Disturb access in your device settings. At the top of the homescreen in the Key Mapper app there is a "Fix" button to do this.

How do I give the app more permissions?

If your device is rooted, Key Mapper can grant itself the permission by enabling the "Key Mapper has root permissions" toggle in the settings.

If your device is not rooted you may have to do the following...

Prepare debug interface (ADB)

  1. Enable developer options on your device by going to device Settings -> About Phone and tapping Build Number many times until it says you've enabled developer options. The location of the Build Number may vary between devices.
  2. Enable USB Debugging in developer options and plug your device into your PC.
  3. Download the Android SDK platform tools from here and unzip it.
  4. Open a terminal/command prompt in the unzipped folder.
  5. Type adb devices and your device should show up in the list after you click the prompt on your phone to allow USB debugging from your PC.

A. ENABLED_ACCESSIBILITY_SERVICES

If you just need the accessibility service, e.g. to swap touch buttons, fix it with:

  1. To add KeyMapper to the List of the enabled accessibility providers, type adb shell settings put secure ENABLED_ACCESSIBILITY_SERVICES io.github.sds100.keymapper/io.github.sds100.keymapper.service.MyAccessibilityService.

B. WRITE_SECURE_SETTINGS

If you need more features of KeyMapper, you may grant KeyMapper an entire set of the permissions (Settings.Secure).

  1. Type adb shell pm grant io.github.sds100.keymapper android.permission.WRITE_SECURE_SETTINGS. You can now choose the Key Mapper keyboard without going into the Android settings. If you haven't done step A. proceed with fixing the accessibility service.

For CI builds the package name is io.github.sds100.keymapper.ci.

More features which rely on this set of permission will come in the future. 😀

These permissions persist across reboots but need to be granted after reinstalling the app.

FAQ

Why aren't my Keymaps being triggered?

  1. Disable all battery and memory optimisation features on your device! Consult https://dontkillmyapp.com for how to fix this for each device.
  2. Try REBOOTING!
  3. If you have made sure they are enabled and they have a trigger, restart the accessibility service by turning it off and on again (help below). If none of these solve your problem, report an issue (bottom of this page).

How do I enable the accessibility service?

Open the Key Mapper app and click “Fix”, where it says, “the accessibility service must be enabled”. If that doesn’t work…

  1. Open your device Settings app.
  2. Find and open the “Accessibility” section. On some devices it might not be on the main screen and is sometimes under “System”.
  3. Click the Key Mapper listing.
  4. Press the switch to enable the Key Mapper accessibility service.

If there isn't an Accessibility settings page on your device, follow the instructions on this page to give the app WRITE_SECURE_SETTINGS permission.

Why don't my keymaps work outside the app but they do work when the app is open?

Disable all battery and memory optimisation features on your device. If you have a Xiaomi device enable "no battery restrictions" for this app. Consult https://dontkillmyapp.com for how to fix this for each device.

Why aren't the buttons on my Bluetooth device detected?

Many Bluetooth devices (like headphones) don't work unfortunately. Bluetooth keyboards work most of the time.

Why doesn't the app open in DEX mode?

Samsung Dex doesn't allow apps with a 3rd party keyboard to open while in Dex mode. You can still configure key maps while out of Dex mode and your key maps which don't require a Key Mapper keyboard will still work in Dex mode.

Why doesn't the app uninstall?

You have probably enabled the app's device administrator in your device's settings. To uninstall the app, you must turn it OFF. The location of the device admin settings page varies widely on devices but on skins close to stock-Android it is under "Security" -> "Device admin apps".

Why aren’t the “Keycode”, “Key” and “Text” actions working?

The Key Mapper keyboard must be enabled in your device settings and chosen as the active keyboard.

To enable the keyboard:

Open the Key Mapper app and click "Fix" where it says, "the keyboard must be enabled". If that doesn't work…

  1. Open your device Settings app.
  2. Find and open the “Languages and Input” section. On some devices it might not be on the main screen and is sometimes under “System”.
  3. Click on a Key Mapper keyboard to enable the keyboard. The toggle may be hidden under sub-menus on some devices.

To choose Key Mapper as the active keyboard: ⌨️

  1. Click on the “Choose keyboard” (“Choose input method” on older devices) notification. Or you can click "Choose Keyboard" by opening the menu at the bottom of the home screen within the app.
  2. Click on a Key Mapper keyboard.

How do I go back to my default keyboard?

Change the active keyboard as described above to your preferred keyboard.

Why isn’t the Key Mapper “choose keyboard” notification working?

On Android 8.1 and newer, ROOT permission is required since Google has blocked the ability for apps to open the input method picker outside of the app. Therefore, this feature is not available on these newer devices. If your device isn’t rooted, Use the Android system's “Change keyboard” notification instead by tapping somewhere you can type and pressing the notification in the notification drawer. If your version of Android doesn't show a notification then there might be an icon in your navigation bar.

Volume increases to max/minimum when pressing power and the respective volume button when the phone is off

This seems to be a bug with accessibility services on Android Pie and newer for some devices. It happens with the Macrodroid app as well when you only enable their accessibility service which filters keyevents. I tested Key Mapper with no code in the onKeyEvent function in the accessibility service and it still happens. I've tested it on a rooted OOS Android 10 OnePlus 6T, rooted stock Android Pie custom ROM on the OnePlus 6t, non-rooted OOS Android 10 OnePlus 7 Pro. It doesn't seem to happen with Android 10 on the Pixel 2.

Why can't I remap some of my Joy Con buttons?

Not all the Joy Con buttons are visible to accessibility services. There isn't anything the developer can do.

We tested the app on SwitchRoot Android and this is what works...

Working:
  • ZL (Button L2)
  • L (Button L1)
  • - (Select)
  • + (Start)
  • Left analog stick button (unknown keycode 0)
  • ZR (Button R2)
  • R (Button R1)
  • X (Button X)
  • Y (Button Y)
  • B (Button B)
  • A (Button A)
  • Home (Home)
  • Volume up (Vol up)
  • Volume down (Vol down)
Not working:
  • Screenshot button
  • All D-Pad buttons (used by OS)
  • Both analog sticks (used by OS)
  • Right analog stick button
  • SR and SL (left joycon)
  • SR and SL (right joycon)
  • Power button

Supported keys for screen off triggers and constraint

This feature only works on rooted devices and Key Mapper version 2.1.0+. Let the developer know about any keys you would also like to be supported.

  • Volume Up
  • Volume Down
  • Headset button

How can I report an issue?

The preferred way is to create a Github issue. If you can't do that then leave a review on the Google Play store or go to the XDA thread, Discord server linked in the README and About activity. 😀

Nothing here helps. I need even more help!

Head over to the Discord server and someone will probably help you! If you don't have Discord, politely email the developer at developer.sds100@gmail.com.