[APP] Button Mapper - Customize your hardware buttons

Search This thread

yuny14utv

New member
Mar 30, 2021
4
0
HI @flar2

Yes i can choose that application however cant find button to map it with.
On my Extron touch panel it seems " Input TV" is the source.
However no remote has that button, so i cannot program a button
I found android remote that has 241 however i think that 242 is what i need and cant find remote i can use.

To trigger on my TV it would be Input channels. then its hdmi 1,2,3.4

How can i add this button i think this is what i need?

Antenna/Cable key
Toggles broadcast input source between antenna and cable
KEYCODE_TV_ANTENNA_CABLE = 242
 

gsearle

Member
Jun 8, 2011
7
1
www.gregsearle.com
Feature request: I am using Button Mapper to remap the volume keys on a book reader tablet to control screen brightness, but the control is too fine. How about a setting to set the increment of the brightness? I was using a Tasker script to do this, but had to remove Tasker due to memory constraints and ever-expanding resource demands from updates.

Tasker Details:
Brighter = min(floor((%BRIGHT + 10) * 1.5),255)
Dimmer = max(ceil((%BRIGHT - 10) / 1.5),0)
 

couitchy

Member
Mar 21, 2017
10
0
Hello !
Many thanks to @flar2 for this great app.
I disabled Bixby and remapped the hardware button to perform other actions : long press opens an app and short press locks the screen. This works very well but there is a slight glitch: when attempting to lock the screen, it goes off immediately BUT then it turns back on very briefly (flickering is no more than 100 ms), and only then it goes off and is locked.
Occasionally it behaves normally but most of the time it happens as I just described.
I also noticed that if the screen is on while the phone is still locked, then pressing the button works fine (no flickering).
I have a Samsung Galaxy S10e, stock Android 9 Pie firmware, no root, and I am using Nova Launcher.
I wonder if some other users encountered this small problem?
 
Last edited:

tiho5

Senior Member
  • Jun 21, 2010
    2,524
    950
    Bulgaria
    @flar2
    Sorry for the OT.

    If I were you I'd make the next Titanium Backup.
    Everyone knows you know things inside out for this.
    Swift backup is OK, but everyone knows how immature it is.
    I can picture ElementalBackup...
    Do it, mate.
     

    flar2

    Recognized Developer
    Jun 11, 2012
    18,521
    87,281
    Southwestern Ontario
    elementalx.org
    Hello !
    Many thanks to @flar2 for this great app.
    I disabled Bixby and remapped the hardware button to perform other actions : long press opens an app and short press locks the screen. This works very well but there is a slight glitch: when attempting to lock the screen, it goes off immediately BUT then it turns back on very briefly (flickering is no more than 100 ms), and only then it goes off and is locked.
    Occasionally it behaves normally but most of the time it happens as I just described.
    I also noticed that if the screen is on while the phone is still locked, then pressing the button works fine (no flickering).
    I have a Samsung Galaxy S10e, stock Android 9 Pie firmware, no root, and I am using Nova Launcher.
    I wonder if some other users encountered this small problem?
    I don't have the s10 series, but have not noticed this on my other Samsung phones. Not sure what it could be
     
    looking for a bit of advice. I'm trying to use a shortcut to change the inputs on my AV Receiver from my Nvidia Shield
    The only way i have found really to do this is to pass a URL to the AVR

    https://<AVR-IP:10443/ajax/globals/set_config?type=7&data=<Source zone="1" index="5"></Source>&_=1618483186631

    this the URL that I need to use. I've tested it from a web browser and it is fine. Trying to add it to button mapper as a HTTP POST and it just doesn't work.
    I figure it is probably something to do with the certificate. Is there any way i can get around this as I am assuming that the CURL command that is being used isn't using the -k switch which ignores invalid certificates.

    Any other suggestions to do what i need here?
    Using URL shortcut as an option just tells me that there is no app to do that. And even if there was, I'm guessing that it would leave the web browser open afterwards, which wouldnt be ideal.

    thanks in advance
     

    Andykt76

    Member
    Jan 24, 2019
    22
    7
    Hi all, hope someone can help me, I use my Nvidia Shield to play gamestream from my PC. However I don't use my gampad connected to the Shield, instead it's linked via Bluetooth to the PC (so I can use the gyro in Cemu). I also have a Harmony Ultimate connected to the Shield. Doing it this way, I lose the functionality of holding start on my controller to bring up the Nvidia Gamestream options and fast close the game. What I'm looking to do is map a button on my harmony that simulates that hardware start button. Any idea how I can do this? I have the pro version of Button Mapper. Thanks for any help!
     

    Andykt76

    Member
    Jan 24, 2019
    22
    7
    Keys I'm hoping to clone

    Gamepad - B (closes Nvidia Gamestream overlay)
    Gamepad - Y (open keyboard)
    Gamepad - Start long press (opens Gamestream options)
     
    Last edited:

    Andykt76

    Member
    Jan 24, 2019
    22
    7
    Really struggling to find any guide on this. So far, what I've done is map one of the coloured buttons on my Harmony remote to Nvidia Shield F1. Then I've tried to remap the custom keycode 97 (button b on a gampad) but it doesn't work.

    Then I tried using the script option:

    Input gamepad keyevent button_b

    Nothing. Any help would be greatly appreciated!

    If there any any useful guides someone you point me to also please?
     

    couitchy

    Member
    Mar 21, 2017
    10
    0
    I don't have the s10 series, but have not noticed this on my other Samsung phones. Not sure what it could be
    I developped a small app which locks the screen, then terminates itself. Then inside ButtonMapper, I mapped the button to launch my app and everything is working fine now: no more flickering!
    Just out of curiosity, I am wondering what is the method you use to lock the screen ? input keyevent 26?
    EDIT: I used GLOBAL_ACTION_LOCK_SCREEN but still noticed some flickering. However, putting the call inside a post delayed handler (delay = 35 ms) solved the issue.
     
    Last edited:

    lukeoverhere

    Member
    Feb 17, 2015
    9
    0
    Public intents

    flar2.homebutton.PAUSE_REMAPPING
    flar2.homebutton.RESUME_REMAPPING
    Thank you -
    1a. Can you please confirm I need root or not to broadcast intents?
    1b. Do I insert those above values in the two 'key:values' sections of 'intent to broadcast?'
    1c. And if so, do I change the secondary button item value to my added button name (i.e. flar2.function119.PAUSE_REMAPPING & flar2.function119.RESUME_REMAPPING) perhaps?

    Please let me know.
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 1
      i get the Umi Digi Bison
      and i must to say that this app is the only one that do not crash
      it is awesome!
      really congratulations!
      1
      Hi @flar2
      the app has stopped recognizing my
      GoogIe Assistant button after update to Android 11.
      1
      Recently upgraded to the Note 10 pro (stock Rom, no root) and followed the ADB solution for screen off actions (enabled both ADB and Xiaomi specific permissions in ADB too) but it seems to not work correctly.

      It works as long as I have the phone connected to the pc but as soon as I unplug the phone screen off does not work and is disabled again in the options.
      I tried to re-enable it a couple of times and make sure all permissions are enabled but it does not seem to fix it.
      1
      Hi, I am trying to remap volume up in the google camera, under video recording, I want the volume up button to toggle the pause and resume button that is onscreen.

      I have disable Bypass Camera to allow the app to work in camera.

      I am struggling with binding volume up to a onscreen button inside aps.

      Any help appreciated thank you
      You can't remap on screen buttons.
    • 132
      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.




      .
      30
      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
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone