[FREE] [OPEN SOURCE] Keyboard/Button Mapper [NO ADS] [4.4+]

Search This thread

tarun0

Senior Member
Sep 7, 2017
81
13
Samsung Galaxy S9+
I see, thanks again. Would you suggest to try another key mapping app that might work with these three buttons? I use yours for the fingerprint spot and fidn it just great. I'd like to get a more flexible management of the main menu.

You can try using a bluetooth/external keyboard to record the trigger. I successfully logged them but didn't try changing them.

If you don't have Bluetooth keyboard then you can check this app "Serverless Bluetooth Keyboard by AppGround IO" on some other device to make that device serve as Bluetooth keyboard. I captured the triggers using this method only.
 
Last edited:

tarun0

Senior Member
Sep 7, 2017
81
13
Samsung Galaxy S9+
@sds100 Is there any way to log/check why the app fails after some time despite satisfying all requirements (Accessibility, Keymapper keyboard etc)? I am using Huawei Tablet but have disabled battery optimisations as well as disabled auto-management by Huawei software but the app seems to be losing key captures.

I'm using Bluetooth keyboard and keymapper successfully changes the input method to Keymapper keyboard but doesn't capture keys.

Edit: It works after disabling and re-enabling Accessibility for Keymapper. But doing this every now and then this would defeat the whole purpose of using the app :/
 
Last edited:

seemebreakthis

Senior Member
Jun 6, 2018
160
40
Xiaomi Mi 11
Hello @sds100 ,

Thanks for this app first of all. I just got a new phone and decided to use this app instead of "button mapper" that I was using for my Xiaomi Mi 9. Because this app has the "vol up + vol down" combo.

Basically with my Mi 11, what I want to do is to press vol up + vol down and the flashlight turns on. Very convenient especially at night.

It works great, except when the screen is off, in which case I have to give it a tap so something gets displayed (usually the fingerprint graphic) and then the vol up and down works again.

I doubt the process gets killed, because it works everytime when something is displayed even when phone is locked. And if always on is enabled, then it always works.

Again thanks for this app !
 

sds100

Senior Member
Mar 4, 2019
131
71
@sds100 Is there any way to log/check why the app fails after some time despite satisfying all requirements (Accessibility, Keymapper keyboard etc)? I am using Huawei Tablet but have disabled battery optimisations as well as disabled auto-management by Huawei software but the app seems to be losing key captures.

I'm using Bluetooth keyboard and keymapper successfully changes the input method to Keymapper keyboard but doesn't capture keys.

Edit: It works after disabling and re-enabling Accessibility for Keymapper. But doing this every now and then this would defeat the whole purpose of using the app :/
Sorry that I missed this. Other people have reported this issue on some devices but I have never been able to reproduce this. Does the latest 2.3.0 release in the github repo fix this?
 

sds100

Senior Member
Mar 4, 2019
131
71
Hello @sds100 ,

Thanks for this app first of all. I just got a new phone and decided to use this app instead of "button mapper" that I was using for my Xiaomi Mi 9. Because this app has the "vol up + vol down" combo.

Basically with my Mi 11, what I want to do is to press vol up + vol down and the flashlight turns on. Very convenient especially at night.

It works great, except when the screen is off, in which case I have to give it a tap so something gets displayed (usually the fingerprint graphic) and then the vol up and down works again.

I doubt the process gets killed, because it works everytime when something is displayed even when phone is locked. And if always on is enabled, then it always works.

Again thanks for this app !
Hi!
Unfortunately Android doesn't allow accessibility services to detect the button presses when the screen is off. There is no solution for this. There are only very very restrictive "solutions" for this which won't allow you to do what you want to do.
Have a good day!
 
  • Like
Reactions: seemebreakthis

Windsor1959

Senior Member
Apr 27, 2011
379
93
@sds100: Just want to thank you for developing this app! It is the first app that allowed me to do what I wanted to do on my device, and I tried a number of apps and approaches.

Recently, I bought a Nook Glowlight 4. That is an E-ink reader with a six inch display that runs Android 8.1. There's no obvious way to install apps, but with a little hunting, I found where such things as developer settings were hidden. That opened the door to ADB, which allowed me to install a launcher and a few apps, mainly reader apps.

The Nook has physical page-turn buttons. Well, I wanted to see if I could set things up so that those buttons would be functional on my third party reader apps. I rooted my device and tried a few options. Your app was the only one I found that allowed me to have a setup where the page-turn buttons would work on both the Nook stock reader and the third party apps! B&N did a few weird things with the way the Nook is set up, which makes finding your app all the better.

Thanks again!
 

sds100

Senior Member
Mar 4, 2019
131
71
@sds100: Just want to thank you for developing this app! It is the first app that allowed me to do what I wanted to do on my device, and I tried a number of apps and approaches.

Recently, I bought a Nook Glowlight 4. That is an E-ink reader with a six inch display that runs Android 8.1. There's no obvious way to install apps, but with a little hunting, I found where such things as developer settings were hidden. That opened the door to ADB, which allowed me to install a launcher and a few apps, mainly reader apps.

The Nook has physical page-turn buttons. Well, I wanted to see if I could set things up so that those buttons would be functional on my third party reader apps. I rooted my device and tried a few options. Your app was the only one I found that allowed me to have a setup where the page-turn buttons would work on both the Nook stock reader and the third party apps! B&N did a few weird things with the way the Nook is set up, which makes finding your app all the better.

Thanks again!
Hi! I'm happy to hear that you like the app 🙂. It is always great to hear the cool ways people find to use this app.
 

Windsor1959

Senior Member
Apr 27, 2011
379
93
Hi! I'm happy to hear that you like the app 🙂. It is always great to hear the cool ways people find to use this app.
What did the trick for me specifically was the ability to have a physical button simulate a tap on the screen. That allowed me to use the physical buttons with apps that are not coded for use with physical buttons.

A few years ago, someone came up with a complicated way to achieve something similar with an Android E-ink device, using Tasker and Xposed. Your app does all that for me, and far more simply! Thanks again!
 

chnzshyguy

Senior Member
Jun 9, 2006
148
7
Love this app! Is it possible to include "work profile" apps to make them addressible for action targets?
 

AlexViean

Member
Sep 4, 2013
12
5
Toronto
Getting "unknown keycode 0" when remapping bluetooth remote control?

So I'm using Key Mapper on Chromecast w/ Google TV so adding a customed .kl file is out of question (no root). I got a Xiaomi bluetooth remote control, codename XMRM-010. It's not supported by default on GwGTV but I managed to pair successfully using a bluetooth manager app.

Problem is all of the programmable buttons get an "unknown keycode 0" when I try to map them. I found this app "External Keyboard Helper Pro" and it could recognize all the buttons and their respective scancodes. Only issue is it only works as an input method a.k.a when focus is on an input field (on-screen keyboard is needed) and hasn't been updated since 2016. No service appears in accessibility.

Therefore I'm pretty sure this "unknown keycode 0" is on the app level and can be resolved with an update of scancode database? Or at least something like a "manually input scancode" feature if possible?


Screenshot_20220404-020248.png
Replicating the issue on my tablet for the sake of better screenshots but everything else is accurately the same. Issue on Key Mapper
Screenshot_20220404-020230.png
External Keyboard Helper Pro can recognize all scancodes (3 digit numbers) and map them correctly. The keycodes I chose here were for reference but others like (Search, Back, Home,...) do work


 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Hello there! :)

    Key Mapper is an open source key mapping application, which aims to remap any combination of your keys/buttons and provide unique features.
    It is currently in beta and any feedback (positive or negative) would be greatly appreciated. :eek: Please post your thoughts in the thread or send me an email.

    First things first...

    Downloads!
    XDA Labs: https://labs.xda-developers.com/store/app/io.github.sds100.keymapper

    Google Play: https://play.google.com/store/apps/details?id=io.github.sds100.keymapper

    F-Droid: https://f-droid.org/en/packages/io.github.sds100.keymapper/

    GitHub: https://github.com/sds100/KeyMapper/releases

    Source code
    https://github.com/sds100/KeyMapper

    Donations
    Ko-Fi: https://ko-fi.com/sethschroeder

    What can be remapped?

    There is NO GUARANTEE any of these buttons will work and this app isn't designed to control games. Your device's OEM/vendor can prevent them from being remapped.

    ONLY HARDWARE buttons can be remapped.
    • Volume buttons.
    • Navigation buttons.
    • Bluetooth/wired keyboards and mice connected to your device.
    • Buttons on other connected devices should also work but there is no guarantee.

    You can combine multiple keys to form a "trigger" and have as many triggers as you want for each action. You can make a key map only work on a long press and to vibrate as well.

    What can’t be remapped?
    • Pixel Active Edge
    • OnePlus Alert Slider
    • Power button
    • Bixby button

    Your key maps don't work if the screen is OFF.

    What can I remap my keys to do?
    Some actions will only work on rooted devices and specific Android versions.

    • Open an app
    • Open an app shortcut. This feature is very useful since you can tell another app to do something Key Mapper can’t. E.g If your launcher has a shortcut to open the app drawer, you can select that shortcut in this app and make any button open the app drawer.
    • Go back
    • Go home
    • Open recents
    • Open menu
    • Expand notification drawer
    • Expand quick settings
    • Collapse status bar
    • Toggle/enable/disable WiFi
    • Toggle/enable/disable Bluetooth
    • Toggle/enable/disable mobile data (ROOT only)
    • Toggle/enable/disable NFC (ROOT only)
    • Toggle Play/pause media
    • Pause/play media
    • Next/previous track
    • Fast forward/rewind
    • Volume up/down
    • Increase/decrease a specific volume stream
    • Cycle through and change the ringer mode
    • Show the volume dialog
    • Mute/unmute/toggle mute (Android 6.0+)
    • Toggle/enable/disable auto-rotate
    • Force portrait/landscape mode
    • Switch between portrait and landscape mode
    • Toggle/enable/disable auto-brightness
    • Increase/decrease brightness
    • Toggle/enable/disable flashlight (Android 6.0+)
    • Take a screenshot (Android 9.0+)
    • Open the Google Assistant
    • Open camera
    • Consume key event (Do nothing)
    • Lock the device
    • Move the cursor to the end
    • Toggle/show/hide the keyboard
    • Show the keyboard picker (ROOT only for Android 8.1+)

    The Key Mapper input method needs to be selected for these to work and you can’t use a soft keyboard at the same time:
    • Input a specific keycode
    • Input a key
    • Insert a block of text

    More will be added. If you have any ideas, leave a comment or email the developer.

    What other things can the app do?
    • Option to show a persistent notification which can pause/resume your keymaps. It can also open the accessibility settings on the device to enable/disable the service. Rooted devices can start/stop the accessibility service without going into settings and just tap the notification.
    • Automatically change the input method to the Key Mapper one and/or show the input method picker when a chosen Bluetooth device is connected and switch back to the old one when it is disconnected.
    • Option to show a toast message whenever an action is performed.
    • Option to log events and send them to the developer so it is easier to debug issues with the app.

    Planned features
    • Double tap to perform an action
    • Remap media (i.e volume, headset) buttons when the screen is off. Android only allows apps to detect media buttons when the screen is off.
    • Action to broadcast an intent with extras.
    • Multiple profiles which can be activated and deactivated automatically when a Bluetooth device is connected or when you open an app.
    • Integrate the AOSP keyboard into the Key Mapper input method so a soft keyboard can be used at the same time.
    2
    is it possible to remap the play / pause button of the bluetooth headset to start Assistant?where is the download?
    I haven't tried using buttons on a Bluetooth headset but I have tried using the buttons on a wired headset and it does work. Most buttons should work as long as they don't have a proprietary implementation in the Android skin you're using. E.g Bixby, Pixel Active Edge. XDA doesn't allow new members to put links in posts until they have posted 10 times for security reasons. Once I can, I will definitely put links in the description.
    2
    is it possible to remap the play / pause button of the bluetooth headset to start Assistant?where is the download?
    https://forum.xda-developers.com/android/apps-games/app-keyboard-button-mapper-t3914005

    Here is the link to the app on XDA labs
    2
    I haven't tried using buttons on a Bluetooth headset but I have tried using the buttons on a wired headset and it does work. Most buttons should work as long as they don't have a proprietary implementation in the Android skin you're using. E.g Bixby, Pixel Active Edge. XDA doesn't allow new members to put links in posts until they have posted 10 times for security reasons. Once I can, I will definitely put links in the description.
    Update: I can add links on mobile completely fine. :laugh: