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:
-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.