• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP] Button Mapper - Customize your hardware buttons

Search This thread

marciozomb13

Senior Member
Apr 30, 2012
1,396
2,378
Rio de Janeiro
Samsung Galaxy A51
Is there any way to prevent the application from killing? Often on my Andtoid TV (philips) it happens that the mapping keys does not work, the reason - something has killed the Button Mapper app. Running it solves the problem for a while, until the system kills again.

Lottery or button mapping works or not - it's a bit frustrating.
Why not ask to your TV manufacturer?
 

jcastro272

New member
Nov 11, 2021
1
0
Hey so i bought the pro version but im not familiar with remapping my mouse buttons.

What i want to do is make it like if pressed the number one number on a keyboard and another button to be as if i pressed enter on a kyboard.

Really appreciate the help i know there someone out there that they can do it in their sleep 😴😴 thanks !!
 

luksson

Member
Nov 1, 2010
29
5
Halmstad
Hi, if someone could help out a bit. I have a Philips android Tv and I want to map a button to switch to HDMI 1. I can send: adb shell input keyevent KEYCODE_F6 from the computer and
Code:
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000
but I am not able to make it work in Button mapper. I have the Pro version.
 
Last edited:

flar2

Recognized Developer
Jun 11, 2012
18,699
87,633
Southwestern Ontario
elementalx.org
Hi, if someone could help out a bit. I have a Philips android Tv and I want to map a button to switch to HDMI 1. I can send: adb shell input keyevent KEYCODE_F6 from the computer and
Code:
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000
but I am not able to make it work in Button mapper. I have the Pro version.
Did you try the "broadcast intent" action?
 

ariscot

New member
Nov 24, 2021
2
0
Does the action http post has a special sintax ?
I'm using the following url:
http://172.18.5.111/api/webhook/luz_principal_sala_wk
It didn't work.
If i run from my desktop with:

curl -X POST http://172.18.5.111/api/webhook/luz_principal_sala_wk

It works fine.
Thanks in advance !

I figure it out, I have a reverse proxy to my home assistant because of other issues (google home x my localy generated certificate ) , then I take a look at nginx logs and happens that http post is sending GET requests ! The workaround for me was to transform the get request to an post request at the nginx, to that I configured as follows:
NGINX:
server {
        listen 80;
        listen [::]:80;

        access_log /var/log/nginx/reverse-access.log;
        error_log /var/log/nginx/reverse-error.log;
        location /api/webhook/ {
                    proxy_pass https://172.18.5.106;
                    proxy_method POST;
  }

        location / {
                    proxy_pass https://172.18.5.106;
           # proxy_method POST;
  }
}

the first "location" takes care of Button Mapper requests, the second does the job as before (fix the google home + home assistant integration for voice).
 

Swingal

Member
Nov 17, 2010
45
17
Bratislava
Google Pixel 6 Pro
Hi, I want ask, I have an Google Pixel 6 Pro, I would like to remap the power button but I cant get to map it. I see all other buttons (volume up/down, heasdset button, home button etc.) But I dont see power button even if I go through more options menu. Is there any chance I can add it somehow?

Thank you
 

theblitz707

Senior Member
Mar 22, 2019
54
6
Hello, i use button mapper to increase my brightness by holding volume up button. Im using s10+. There is an option to reduce screen size for one hand use. After doing that, volume button wont work for brightness and i have to restart button mapper. Its no big deal but would be cool if addressed
 

violetvybes

New member
Dec 4, 2021
1
0
online
hello, i upgraded to a Nokia X100, and the Assistant Button no longer shows up as an option to remap. i'm on unrooted Android 11, is there a workaround for this?
 

officiallyme

Senior Member
Jul 19, 2011
900
136
Hi everyone,
I am running button mapper on my Sony XF9005 and it works great.
But would it be possible to call two actions with one button press?
I would like to turn off wifi and then turn off the tv. But it needs to be the same button otherwise the family will simply forget to turn off wifi ;)

Reason: Android TV sucks when it comes to standby power consumption. My TV turns on every few minutes if wifi is on. I have disabled everything I could and Google still keeps calling home.
 

crosis99

Member
Apr 4, 2019
10
0
PROBLEM

The TV Remote's Power Button only turns ON/OFF the TV and not the STB. Can Button Mapper Help??


TV: Sony Bravia XBR-75X800H Smart TV (Android 9)
STB: Nextbox 9865HD (Cisco, Rogers Cable TV) connected via HDMI



Important
  • The TV recognized and setup the STB connection via HDMI and UEI QuickSet.
  • The TV displays a special on-screen menu just for the STB for various functions + STB Power ON / OFF.
  • The TV Remote controls Channel Changing ONLY via Infrared to the STB.
  • The TV Remote's physical POWER button only controls the ON/OFF state of the TV.
  • One must use the TV's special on-screen menu for the STB to Power ON / OFF the STB.

GOAL

I would like to power on/off the STB in sync with powering on/off the TV -- so if i tap the TV remote's physical power ON/OFF button the TV and STB power ON/OFF accordingly.

The TV's on-screen menu for the STB is clearly sending some signal over HDMI to control the on/off of the STB. Is it possible to capture the HDMI command being issued to the STB to then issue the same command with the TV remote's power button or some other physical button?
 
Last edited:

Windsor1959

Senior Member
Apr 27, 2011
365
88
Here's my scenario. I just purchased a Nook Glowlight 4. It's an E-ink device that runs Android 8.1. It doesn't have Google Play, but with ADB it is possible to install a launcher and apps without root. I have installed a few other reader apps and have rooted the device.

The Nook has page up and page down physical buttons, two on each side of the screen. They work with the stock reader, but third party reader apps don't seem to recognize physical buttons.

I'm wondering if Button Mapper can help me here. One way is if it could allow a button to simulate a screen tap. Is that possible with Button Mapper? Thanks!
 

sosimple

Senior Member
Aug 20, 2017
2,174
27
47
Greece
www.youtube.com
Here's my scenario. I just purchased a Nook Glowlight 4. It's an E-ink device that runs Android 8.1. It doesn't have Google Play, but with ADB it is possible to install a launcher and apps without root. I have installed a few other reader apps and have rooted the device.

The Nook has page up and page down physical buttons, two on each side of the screen. They work with the stock reader, but third party reader apps don't seem to recognize physical buttons.

I'm wondering if Button Mapper can help me here. One way is if it could allow a button to simulate a screen tap. Is that possible with Button Mapper? Thanks!
IF button mapper recognize the buttons, then you can create an app/script to simulate a screen tap with Tasker , and call this app from mapper.
 

puszcza

Senior Member
Jan 31, 2012
108
9
Hello,
I am looking for help with custom script to launch Android 9 TV system Network & Internet settings.
To be more precise - I am using Philips 2020 Performance TV with Android 9 TV. Wanted to use official Android Data Saver plugin - https://beebom.com/enable-data-saver-mode-android-tv/. When I launch Android settings in my TV there is no options for Network & Internet. I can only change it using Philips UI, so I cannot access installed data Saver plugin.

Any guide/script will be helpfull.
 
Last edited:

eqagunn

Senior Member
Jan 13, 2015
54
19
Hi. I'm using the app on Android 10 TV and it's causing the TV to freeze for 2 seconds every 30 seconds.
Ran only pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
Mapped only the Menu (82) button via Custom Keycode v2.

Looking to map Clear All App Cache and Disable AUX Audio Output if possible.
And a solution to the freezing issue, please.
 
Last edited:

flar2

Recognized Developer
Jun 11, 2012
18,699
87,633
Southwestern Ontario
elementalx.org
Hi. I'm using the app on Android 10 TV and it's causing the TV to freeze for 2 seconds every 30 seconds.
Ran only pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
Mapped only the Menu (82) button via Custom Keycode v2.

Looking to map Clear All App Cache and Disable AUX Audio Output if possible.
And a solution to the freezing issue, please.
I would say this is not caused by Button Mapper, I have many TV boxes and many, many thousands of Android TV users. Nobody has ever reported this and I can't think of any reason why there would be any type of pause other than latency of just under 1sec for a custom keycode press (this would not interrupt the system as a whole)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hello,
    since saturday I use Android 12 on my Samsung Galaxy S10. Under Andoid 11 Button Mapper works perfect. But now I cannot remap the bixby button no more.
    If I connect my S10 with the buttonmapper.setup.app I get a failed message too. Whats is worng? Thank you for your answer.
    I'm working on an update
    1
    No. Where cain I find the note?

    It's written at the top of the link shown when you setup Bixby

    setup.buttonmapper.app
    1
    Is it true that button mapper doesn't yet support Android 12?
    No, it has been updated since the previews. The most recent update fixes Bixby remapping on Android 12, which Samsung changed yet again.
    1
    Hello,

    I have a Samsung S10e (SM-G970F) and I can't remap the Bixby button.
    After connecting the smartphone on the computer, "ButtonMapperSepup" application confirm that the device is connected but, when I press "Enable Bixby remapping", I have a "Failed !"

    I tried also all other function, but still have a fail....

    Any tips to give me?

    (I just updated my phone to A12/OneUI 4.0 2 days ago)

    Thanks!!
    What about reading the previous posts literally above yours?
    1
    What about reading the previous posts literally above yours?
    Yes, thanks..... sorry !! :rolleyes:
    Just tried it and yes, in manual it works fine !!!!
    Thank you again for the support !!
  • 138
    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