[APP] Button Mapper - Customize your hardware buttons

Search This thread

jbs68

Senior Member
Nov 13, 2009
408
59
Montbéliard
Samsung Galaxy S21 FE
That's the phone I have, with same OS. This app worked fine on that. It doesn't do screen-on while phone is locked which forced me to switch back to bxActions but app looked to be working fine otherwise.
Sorry, I don't understand. You mean that you have the same phone as mine?
On my Samsung S10e under android 12, this app works fine (screen on and off) but I just miss the possibility of setting different function in the two mode.
 

darkcosmo

New member
Sep 19, 2010
2
1
Hi, first of all: Thank you for this Amazing App.

Now, i was wondering if there is a possibility to acces the device control using the app.

Device control in Samsung One ui 4 is placed with the rest of tiles, left of multimedia.

Excuse my poor English U_U
 

PSBJ

Member
May 27, 2013
29
6
Not sure if this has been reported, but there's a tiny bug on Android TV/Google TV (Sony BRAVIA 4k VH2, specifically the X85J). Whenever I press one of the buttons I've remapped on my remote, the LED on the TV that flashes to indicate a button was pressed repeatedly flashes and doesn't stop until another button is pressed.

It's really insignificant because you end up pressing other buttons anyway, but I figured I'd report it.

Thanks for the great work!
 

redsmith

Senior Member
Apr 11, 2011
712
375
Hi flar2,

I'm experiencing a weird bug on A12 (rooted, stock kernel, screen-off only). Toggle flashlight works perfectly on "volume up double tap", but behaves erratically on "volume up long press". I'd very much like to use long press, but it doesn't work consistently. Tried switching to alternate input method, alternate button handling, but no luck so far. What gives?
 

flar2

Recognized Developer
Jun 11, 2012
18,780
87,749
Southwestern Ontario
elementalx.org
Hi flar2,

I'm experiencing a weird bug on A12 (rooted, stock kernel, screen-off only). Toggle flashlight works perfectly on "volume up double tap", but behaves erratically on "volume up long press". I'd very much like to use long press, but it doesn't work consistently. Tried switching to alternate input method, alternate button handling, but no luck so far. What gives?
I don't know, there were no changes to button remapping for Android 12 and it works perfectly on all my Android 12 devices.
 
  • Like
Reactions: redsmith

redsmith

Senior Member
Apr 11, 2011
712
375
I don't know, there were no changes to button remapping for Android 12 and it works perfectly on all my Android 12 devices.
I've just realized that this only happens with AOD on. As soon as AOD is turned off, toggling flashlight with "long press on volume up" works perfectly. Toggling flashlight with "double tap on volume up" works fine either way, weirdly enough. Just a little heads up.
 

etdr

New member
Feb 11, 2022
1
0
Together with FLauncher this is a gamechanger for my BRAVIA television, so regardless of what else I can get working I want to say thank you so much for your work.

I'm running the pro version of Button Mapper, from what I can tell the BRAVIA is on Android 10. Trying to run the keycode shell script over adb has been a bust, the flar2.homebutton directory is not accessible to me in the /data/data (permissions), and I can't find any such directory in an Android/data directory anywhere. I do have a USB drive plugged in and right now the app is installed on that, but I've tried installing it on internal storage and doesn't seem to change anything.

Am I right that I would need to root my TV (imagine telling someone that twenty years ago) to get at /data/data? I'm not sure what else to try at this point. I did get this line out of pm:

Code:
dataDir=/mnt/expand/95310d84-06bf-45cb-83ba-3a959ca35e3d/user/0/flar2.homebutton

..which I'm also denied access to. Or do you have any other suggestions? I'm sorry if I missed anything. Again, stellar tool you have here.
 

flar2

Recognized Developer
Jun 11, 2012
18,780
87,749
Southwestern Ontario
elementalx.org
Together with FLauncher this is a gamechanger for my BRAVIA television, so regardless of what else I can get working I want to say thank you so much for your work.

I'm running the pro version of Button Mapper, from what I can tell the BRAVIA is on Android 10. Trying to run the keycode shell script over adb has been a bust, the flar2.homebutton directory is not accessible to me in the /data/data (permissions), and I can't find any such directory in an Android/data directory anywhere. I do have a USB drive plugged in and right now the app is installed on that, but I've tried installing it on internal storage and doesn't seem to change anything.

Am I right that I would need to root my TV (imagine telling someone that twenty years ago) to get at /data/data? I'm not sure what else to try at this point. I did get this line out of pm:

Code:
dataDir=/mnt/expand/95310d84-06bf-45cb-83ba-3a959ca35e3d/user/0/flar2.homebutton

..which I'm also denied access to. Or do you have any other suggestions? I'm sorry if I missed anything. Again, stellar tool you have here.
Uninstall and reinstall, then use adb over WiFi to issue the command manually (use the exact command on setup.buttonmapper.app). It works on all my TVs, including a Sony. Android version doesn't matter for the script until Android 12, and root is not required.
 

Pakabidu

Senior Member
Aug 27, 2013
53
5
Great app, thanks for keeping this going!

Anyone can help with toybox commands please? Running Android 10 on Chromecast with Google TV and want to map my home button to reboot the system on long press. Using Button Mapper Pro version. When I try 'reboot' I get the message 'toybox: Unknown command reboot (see "toybox --help")'. Other commands seem to work OK, for example 'uptime'.

Thank you!
 

flar2

Recognized Developer
Jun 11, 2012
18,780
87,749
Southwestern Ontario
elementalx.org
Great app, thanks for keeping this going!

Anyone can help with toybox commands please? Running Android 10 on Chromecast with Google TV and want to map my home button to reboot the system on long press. Using Button Mapper Pro version. When I try 'reboot' I get the message 'toybox: Unknown command reboot (see "toybox --help")'. Other commands seem to work OK, for example 'uptime'.

Thank you!
Unfortunately, you can't do really anything on Android anymore. Permission denied for even a simple thing like reboot or listing files in a folder.

Best option is probably to map to the power dialog, where you can then select reboot
 
  • Like
Reactions: Pakabidu

Pakabidu

Senior Member
Aug 27, 2013
53
5
Unfortunately, you can't do really anything on Android anymore. Permission denied for even a simple thing like reboot or listing files in a folder.

Best option is probably to map to the power dialog, where you can then select reboot
Thanks for reply!

Mapping to power dialog was my first option, problem is once mapped on my Chromecast (with Google TV) it will bring up the dialog but won't let me choose any of the options, then dialog disappears.
 

Pakabidu

Senior Member
Aug 27, 2013
53
5
This is what I mean:

PXL_20220220_120151174.jpg


Power dialog comes up but no button on Chromecast's remote will allow to select any of the options. If anyone knows the solution to this - please share :)
 

VanHydra

Member
Nov 30, 2010
13
2
Before I buy the Pro-Version:
Is it possible to send the keycode "Shift + Tab" with a Hardware-Button with this (without root - adb isn't a problem though)?

Thanks for the reply.
 

sh33p3r

Member
Feb 13, 2011
17
0
I am looking for a keyboard shortcut for Nvidia Shield. I need to remap a button for alt+left and right shortcut. Is t possible?
 

dfg555

Senior Member
Oct 2, 2014
62
1
"Screen off actions" keeps toggling OFF even though I allowed App Permissions through ADB?

Android 11
ColorOS 11 Not rooted
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Can i remap the volume keys on my amazon tv? I installed the app but after opening the app and confirming the closing of the popup it closes, I deleted the chace, restarted the devise, reinstalled but nothing, some sfix?
    I honestly don't know. Try granting WRITE_SECURE_SETTINGS via adb, this will allow the app to start the service.

    adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
  • 142
    p2142635636.jpg



    Button Mapper allows you to remap any action you want to physical or capacitive hardware buttons. This includes volume buttons, camera button, home button on Samsung devices and capacitive home, back and recents, Bixby, Active Edge, LG assistant button and many buttons on game controllers and other hardware. It does NOT work with onscreen home, back and recents buttons (i.e. soft keys or the navigation bar).

    You can launch shortcuts, apps or actions to single press, double tap and long press for hardware buttons.





    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    Limitations:
    -does not work when the screen is off (unless rooted)
    -only works with hardware buttons, not onscreen buttons (i.e. navigation bar)
    -power button cannot be modified
    -there can be quirks with some devices due to non-standard hardware and software implementations by various manufacturers. I try to fix them, but sometimes it's difficult if I don't have the device to test.




    .
    31
    Examples of things you can do with this app:

    -Lockscreen peek: press and hold the home button to quickly check your lockscreen messages, release to turn off the screen (requires PRO VERSION)
    -Launch an app by long pressing the home button
    -Swap the back and recents buttons (capacitive buttons only, like on Samsung Galaxy or Asus Zenfone or One Plus One)
    -Use the home button to the turn the screen off from the homescreen on your Samsung Galaxy (requires PRO VERSION)
    -Control the button lights on your Samsung Galaxy. Turn them on or off, or change the length of time they light up
    18
    Big update!


    After many weeks of work, I've released an update that adds many new features and improvements, and fixes some longstanding bugs.

    The new version is rolling out to a small number of users on the Google Play Store.
    You can download the new version now on XDA Labs.



    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    Pixel 2 Active Edge
    The Pixel 2 battery drain was caused by remapping Active Edge with root and not enabling screen off actions. It has nothing to do with the method that I use to remap the Edge squeeze, it was caused by a typo in the options logic. There are a lot of myths about how this app handles Active Edge. First of all, it does not consume battery and does not slow down your system. Such claims are false (notwithstanding the bug, which is now fixed). The method for remapping Active Edge does not scan through every logcat message. With root, it's 100% reliable and you will never see the Assistant and will remain in your current app. Without root, you will occasionally see the Assistant and it may bring you to the homescreen. The only limitation is you need to use English language until Google enables the Assistant for other languages.

    Root Command
    You can now remap buttons to a root command. This offers unlimited possibilities for power users. Obviously this requires root! It's available in the Pro version only

    Custom Key Codes
    You can also remap buttons to custom key codes. This means you can fully remap game controllers, tv remotes and other hardware attached to your device. I've compiled a list of key codes that are recognized by Android here. This requires root, unfortunately. It's available in the Pro version only.

    MIUI
    MIUI does some really stupid things to Android. In order for Button Mapper to work correctly, you need to grant the "Autostart" permission and disable battery optimization. If you do not grant the autostart permission, swiping Button Mapper away in recents will kill the service. If you do not set battery optimization to "No restrictions", then Button Mapper's service will be killed every 10 minutes or so.

    To grant these permissions, in go to the menu at upper right in Button Mapper and select "Introduction." Swipe to the screen title Permissions and follow the instructions.

    Samsung volume bug
    I tracked down a few obscure bugs on Samsung phones, including the volume scaling bug that I could never reproduce. This occurred when the volume buttons were remapped and then later the "Bixby only" option was selected without rebooting.

    Pirating this app
    Don't install pirated versions of this app (or any app that uses Accessibility or root), even just to try for a few minutes. Because it uses Accessibility Service and root, you must fully trust the developer. Using a pirated version of any root app gives hackers carte blanche on your device.



    • New actions:
      -toggle BlueTooth
      -headset key press
      -change keyboard
      -root command (requres root and PRO)
      -custom keycodes (requires root and PRO)
    • Android TV support
    • Screen off only option (requires root and PRO)
    • Fix battery drain on rooted Pixel 2
    • Update translations
    • Fix volume change for screen off actions
    • Improve Bixby handling
    • Fix volume bug on S8/Note8
    • Improve UI
    • Add 180 rotation to swap volume orientation setting
    • Improve root handling
    • Improve MIUI behaviour
    • New intro
    • Add feedback form
    • Speed and memory optimizations
    • Many other bug fixes and improvements



    .
    15
    Button Mapper update!

    There is an awesome new update for Button Mapper rolling out. You can get it on XDA Labs now, and on the Play Store in the coming days. This update improves volume button behavior, has fixes for Android Pie, improves Bixby remapping, lots of updates for Blackberry devices and adds a bunch of new actions, such as fullscreen mode, invert colors, toggles for NFC, airplane mode and mobile data, broadcast intents, Greek and Arabic languages, plus the usual bugfixes.

    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    I want to highlight two important new features.

    First, the broadcast intent action (pro version only!). With this action, you can use a button press to broadcast an intent, which is Android's way of communicating between apps. This opens up literally endless possibilities. For example, if you have my High Brightness Mode app installed, you could enter flar2.hbmwidget.TOGGLE_HBM for long-press of volume button to toggle high brightness mode.

    The second feature is a new option to disable volume button remapping when the volume panel is showing. For example, if you have long press volume down mapped to toggle the flashlight, when the volume panel is showing, holding down volume will turn the volume down rather than turning on the flashlight. Once the volume panel disappears, holding the volume button will once again toggle the flashlight. I think this makes the volume button behavior more intuitive, so it's enabled by default. This can be turned off if you don't like it, the option is in Advanced options->Volume panel bypass.

    Please enjoy, and don't forget to leave a positive review if you find Button Mapper useful.
    12
    Version 0.66 is now released. It will roll out slowly on the Play Store, if you want it now, get it from XDA Labs
    https://labs.xda-developers.com/store/app/flar2.homebutton

    This version has tons of small fixups: volume button behavior is vastly improved, activities open right away after pressing home, everything is faster, and there are more options. Also quite a few UI improvements. New actions include toggle mobile data (root only), toggle wifi hotspot (Nougat and lower only), toggle autobrightness and clearn notifications. There is a new option to enable pocket detection, so actions won't occur while the phone is in your pocket (requires pro version).

    For Android P users, I've fixed the volume buttons to default to media and added an option to force them to control ring volume like older versions of Android.

    There is now an option to lock the screen in a way that allows you to unlock with the fingerprint. Rooted users could always do that, now unrooted users can too.

    I've also added an option to force audio routing through the speaker while Pressy, MiKey or other headphone jack buttons are plugged in. I don't have one of these devices, but it should all work.


    Changes:
    Pocket detection (pro)
    Toggle auto brightness
    Toggle Wifi hotspot (Android 7 and lower)
    Toggle mobile data (root)
    Clear notifications
    Compatibility with Android P
    Option to use speaker with Pressy, MiKey, etc
    Global bypass option
    More long press duration options
    Receive incoming phone calls with home button (Samsung)
    Add Spanish
    Update translations
    UI improvements
    Optional lock method that allows fingerprint unlocking
    Fix AOD crash with screenshot action (Samsung)
    Optimizations and bugfixes