Keyboard/Button Mapper is a free and open source Android app to remap volume, navigation, and Bluetooth/wired keyboard buttons
Following the recent news that Samsung will allow users to remap the Bixby key, XDA Junior Member sds100 has decided to one-up Samsung. Key Mapper allows you to remap any key on your phone to whatever you want, as well as buttons on any Bluetooth/wired keyboard connected to your phone. Buttons on other connected devices may also work, though this is not guaranteed.
Customization options are endless, with the app even supporting combining multiple keys, similar to how you might take a screenshot. Long presses are also supported. There are limitations, however. The power button cannot be remapped, and device-specific features, such as the Pixel’s Active Edge, cannot be remapped.
The list of possible actions to which you can remap buttons is extended if your device is rooted, but a lot of them will still work even without root. Furthermore, some are also dependent on which version of Android you are running.