Saturday, January 21, 2017

XDA Spotlight: Button Mapper, an App to Remap your Phone’s Hardware Buttons

Hardware buttons are increasingly becoming harder and harder to find on Android devices, with most devices these days retaining only the necessary power and volume buttons. Though some users prefer the sleek designs that on-screen navigational buttons offer, others miss having tactile buttons that could be utilized for specific purposes. Thankfully, you can have the best of both worlds with an application called Button Mapper.

Available on the Google Play Store, this tool was developed by XDA Recognized Developer flar2 and it enables the user to remap hardware buttons to activate different functions without root. The application works by tapping into the accessibility framework baked into Android, which means the application can work with most devices including those running on older versions of Android such as KitKat.


Take Control of your Hardware Buttons

There are two versions of this application: a Basic version and a Pro Version. The Basic version limits intercepting only the physical home and volume buttons, but does not otherwise restrict the actions you can perform on these button presses. If you upgrade to the Pro version for a fairly reasonable price (€2.60 for E.U. residents and $2.99 for U.S. residents), you will have access to themes, setting custom vibration levels, more hardware button support (provided your phone has those buttons), and blacklist remapping buttons while within certain applications. The Pro version also provides two additional features if you have a physical home button – lockscreen peek and homescreen lock, which we'll cover below.

When you open the application for the first time you are met with the instructions on what the application can and cannot do. Button Mapper does not hide its limitations either and explicitly states that it can only intercept hardware buttons (that are not the power button) while the screen is on. In order to do this, the application requests that you enable its Accessibility Service. Flar2 makes it quite clear that his application respects your privacy and that the Accessibility Service is used only to intercept hardware button presses.

I personally have very few hardware buttons on my device –  volume up, volume down, and power – leaving me with only two buttons to remap since the power button cannot be intercepted. This is fairly typical for many users (though owners of Samsung and OnePlus devices will have more opportunities to take advantage of this application), so you might ask yourself: Is this application still worth the price?

In my view, it definitely is. I quickly discovered that only having two buttons is not as limiting as it might appear at first. This is because I can actually set 3 actions per button (single tap, double tap, or long press) giving a total of 6 actions for my available hardware buttons. To be fair, I don't recommend you actually override the default single tap action for volume up and volume down, but you totally could if you wanted to.

Button Mapper Themes

So what can you remap your buttons to do? Here is the (long) list of supported actions:

  • Applications
    • Launch any installed application on your phone
  • Shortcuts
    • Launch any available shortcut on your phone
  • Actions
    • Navigation
      • Home
      • Back
      • Recent Apps
      • Last app
    • Assistance
      • Search
      • Launch 'Assistant' App (equivalent of long-pressing home)

    • UI
      • Bring down quick settings
      • Expand/dismiss the notification shade
    • Display
      • Toggle Flashlight
      • Bring up the power dialog
      • Turn screen off
      • Take a Screen Shot
      • Brightness +/-
    • Audio
      • Toggle Do Not Disturb mode
      • Volume +/-
      • Next/Previous Track
      • Play/Pause

As we mentioned before, there are a couple of useful settings located in the Advanced Options menu. First, there are the various "bypass" options. You can set Button Mapper to be disabled when system dialogs are on screen, when using the camera, when in the middle of a phone call, or while using any application that you blacklist. Furthermore, you can set shorter/longer delays for when Button Mapper will recognize a valid input. This can be helpful for users who either press button combinations too quickly or too slowly. I recommend you experiment with timings until you have found one that you can nail 100% of the time.


Rewiring your Buttons

I can definitely think of a few useful reasons why I would continue using this application. One of the first things I did was to add an exception for both Spotify and phone calls so I could continue using the normal volume functions within these applications but still retain my custom hardware mappings otherwise. Another action I set up was to have a long press on my volume down key to trigger taking a  screen shot which is normally more difficult with my bulky case. Next, I remapped a long press on the volume up key to return to the last active application and also made double tap on my volume key to display the recent applications list.

Though my uses here are rather basic, they work great in my case while I'm commuting to work on the metro. In one hand I am holding the grab rail while in the other I am holding my phone. Remapping two to three step actions into a single key is far more convenient for me as I frequently use my phone one-handed. Having a long press to switch to the last active application might sound a bit strange, but I use it quite often when copying text. I find that some apps don't share/copy text that well, so this button remap makes jumping between apps a bit faster for copying or entering two factor authentication codes, for example.

Not every phone has as limited supply of hardware buttons as mine does, though. The OnePlus 3/3T, for example, has that slider button which can be remapped with this application to your chosen action. The Xperia phones typically have a dedicated camera button which can also be remapped. Samsung devices have physical navigation keys, all of which can be remapped to do your bidding. You could, for instance, switch the back and recents key on your Samsung device to better mirror the stock Android navigation layout. With a Samsung Galaxy device, you can also adjust the button light (Basic version) and vibration duration (Pro version).

Samsung Galaxy S6 Capacitive Buttons. (Credits: AndroidExplained)

And if your phone has a dedicated physical home button, you can take advantage of the two features I mentioned in the beginning of this spotlight: lockscreen peek and homescreen lock. The former feature allows you to lock your device by releasing the home button while you are on the lock screen and the latter allows you to lock your device while you are on your home screen (Nova Launcher not required)! Using lockscreen peek, you can hold down on the home button to bring up the lockscreen (and "peek" at your notifications), then release the home button to have the screen turn off. Homescreen lock is more simple, but for those of you with failing power buttons it can be a vital function.

The developer lists a bunch of different potential uses for this application in his Play Store description as well as a few in his XDA forum thread. Ultimately, though, what you can do is totally up to your imagination. Our resident Tasker aficionado, Mishaal Rahman, notes that while you can set up Tasker to intercept button presses using a plug-in like AutoInput, it is far, far easier to use a dedicated application such as Button Mapper. In addition, Button Mapper essentially allows you to perform nearly any action you can ever think of thanks to the ability to launch Shortcuts – which means you can directly launch Tasker tasks in a single (or double or long) press.


Conclusion

What would be nice to have in a future version is distinct mappings while using separate applications, sort of like 'profiles' for each application. For example, I might want to have Spotify change tracks with volume up/down presses but on the desktop have those buttons turn on the flashlight or pull down the quick settings. But currently, the remapping of a button is applied system-wide and does not apply for any individual application.

Overall, though, this is a fairly useful tool in the arsenal of an Android enthusiast. Whether you use it to remap your hardware buttons in a more typical way such as having the volume up and down to change music tracks, or you use it more unconventionally such as in my case, how you use it is dependent on your personal preferences. The application allows you to be as creative as you want, though, the more hardware buttons you have the more fun you can have.


Download Button Mapper from the Google Play Store!



from xda-developers http://ift.tt/2kdtJbq
via IFTTT

No comments:

Post a Comment