FORUMS
Remove All Ads from XDA

[FREE] [OPEN SOURCE] Keyboard/Button Mapper [NO ADS] [4.4+]

54 posts
Thanks Meter: 33
 
By sds100, Member on 22nd March 2019, 08:05 PM
Post Reply Email Thread
Hello there!

Key Mapper is an open source key mapping application, which aims to remap any combination of your keys/buttons and provide unique features.
It is currently in beta and any feedback (positive or negative) would be greatly appreciated. Please post your thoughts in the thread or send me an email.

First things first...

Downloads!
XDA Labs: https://labs.xda-developers.com/stor...s100.keymapper

Google Play: https://play.google.com/store/apps/d...s100.keymapper

GitHub: https://github.com/sds100/KeyMapper/releases

Source code
https://github.com/sds100/KeyMapper

What can be remapped?
ONLY HARDWARE buttons can be remapped.
• Volume buttons.
• Navigation buttons.
• Bluetooth/wired keyboards and mice connected to your device.
• Buttons on other connected devices should also work but there is no guarantee.

You can combine multiple keys to form a "trigger" and have as many triggers as you want for each action. You can make a key map only work on a long press and to vibrate as well.

What can’t be remapped?
• Pixel Active Edge
• OnePlus Alert Slider
• Power button
• Bixby button

Your key maps don't work if the screen is OFF.

What can I remap my keys to do?
Some actions will only work on rooted devices and specific Android versions.

• Open an app
• Open an app shortcut. This feature is very useful since you can tell another app to do something Key Mapper can’t. E.g If your launcher has a shortcut to open the app drawer, you can select that shortcut in this app and make any button open the app drawer.
• Go back
• Go home
• Open recents
• Open menu (ROOT only)
• Expand notification drawer
• Expand quick settings
• Collapse status bar
• Toggle/enable/disable WiFi
• Toggle/enable/disable Bluetooth
• Toggle/enable/disable mobile data (ROOT only)
• Toggle/enable/disable NFC (ROOT only)
• Toggle Play/pause media
• Pause/play media
• Next/previous track
• Fast forward/rewind
• Volume up/down
• Increase/decrease a specific volume stream
• Cycle through and change the ringer mode
• Show the volume dialog
• Mute/unmute/toggle mute (Android 6.0+)
• Toggle/enable/disable auto-rotate
• Force portrait/landscape mode
• Switch between portrait and landscape mode
• Toggle/enable/disable auto-brightness
• Increase/decrease brightness
• Toggle/enable/disable flashlight (Android 6.0+)
• Take a screenshot (Android 9.0+)
• Open the Google Assistant
• Open camera
• Consume key event (Do nothing)
• Lock the device

The Key Mapper input method needs to be selected for these to work and you can’t use a soft keyboard at the same time:
• Input a specific keycode
• Input a key
• Insert a block of text

More will be added. If you have any ideas, leave a comment or email the developer.

What other things can the app do?
• Option to show a persistent notification which can pause/resume your keymaps. It can also open the accessibility settings on the device to enable/disable the service. Rooted devices can start/stop the accessibility service without going into settings and just tap the notification.
• Automatically change the input method to the Key Mapper one and/or show the input method picker when a chosen Bluetooth device is connected and switch back to the old one when it is disconnected. (The app NEEDS ROOT access to change the input method automatically)
• Option to show a toast message whenever an action is performed.
• Option to log events and send them to the developer so it is easier to debug issues with the app.

Planned features
• Double tap to perform an action
• Remap media (i.e volume, headset) buttons when the screen is off. Android only allows apps to detect media buttons when the screen is off.
• Action to broadcast an intent with extras.
• Multiple profiles which can be activated and deactivated automatically when a Bluetooth device is connected or when you open an app.
• Integrate the AOSP keyboard into the Key Mapper input method so a soft keyboard can be used at the same time.
The Following 11 Users Say Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
 
 
22nd March 2019, 11:04 PM |#2  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
CHANGELOG
1.1.0 Beta 7
Added
  • The status card at the top of the homescreen can now be expanded and collapsed
  • Show a toast message when a foreseen error is encountered
  • Logger: log whenever the accessibility service is started/stopped
Bug Fixes
  • App would crash when trying to read a system setting which doesn't exist
  • App would crash if couldn't find the Do Not Disturb settings page
  • Logger: send icon was grey but should be white

1.1.0 Beta 6
Bug Fixes
  • Don't show NFC actions on devices without NFC
  • Couldn't change volume when short pressing a volume button remapped to a long press action

1.1.0 Beta 5
Added
  • Action to enable, disable and toggle NFC.
  • Action to switch between portrait and landscape mode.
  • Action to cycle through and change the ringer mode.
  • Action to fast forward and rewind.
  • Option to log events and send them to the developer so it is easier to debug issues with the app.
  • Button to Help page on homescreen.
  • Translation instuctions to the About activity.

Changes
  • Add the trigger after the 5 seconds rather than having to press the button so the app can work with devices which only have remotes as input.
  • Cleanup Settings strings.
  • Use slightly darker homescreen background.
  • Don't show the "Key mapper is performing an action" toast message by default.
  • Allow the volume to be changed while in Do Not Disturb mode.
  • Minimum vibration duration is 1ms rather than 100ms

Bug Fixes
  • The landscape mode action wouldn't work.
  • Would potentially crash when trying to open the write-settings permission page.
  • Don't show a toast message when enabling/disabling the device admin.
  • Would crash when selecting a shortcut without the correct permissions.
  • Device would go to the homescreen when using a trigger with the home button in it.

1.1.0 Beta 4
Added
  • Option to choose which flash to use for flashlight actions
  • Optimised the New and Edit Keymap activities for various screen sizes
  • Slightly optimised the homescreen for wide screens

Bug Fixes
  • Could potentially crash when trying to switch to the Key Mapper input method
  • Could potentially crash when removing a trigger from the list
  • Would crash if it couldn't find the input method settings page
  • Would crash when trying to change a specific volume stream while the device is in a Do Not Disturb state
  • Would crash when using an app shortcut without the correct permissions.

1.1.0 Beta 3
  • Reduced the repeat delay to 5ms
  • Force expand the menu on the homescreen
  • Made the cards on the homescreen slightly more compact

Added
  • Flag to vibrate and an option to force vibrate for all actions
  • Action which just consumes the keyevent and does nothing
  • Action to lock the device (ROOT only for now) and an option to lock the device securely (without root).

Bug Fixes
  • The bottom app bar on the homescreen would overlap the list items
  • The app would potentially crash when trying to perform a flashlight action whilst the camera is in use in another app.
  • Short press actions with the same trigger as a long press action would be performed with the long press action
  • A keymap would still have the "Show volume dialog" flag if the action is changed to a non volume related action
  • The app would crash if trying to show the menu on the homescreen if it is already showing.
  • The accessibility service status on the homescreen wouldn't change when the service is started/stopped.

1.1.0 Beta 2
  • Won't immediately crash on KitKat anymore!
Bug Fixes
  • Persistent IME notification wouldn't automatically show when it is enabled.
  • App would crash if it couldn't find the device's accessibility settings page.

1.1.0 Beta 1
Added
  • Setting to change the long-press delay.
  • Persistent notification which can pause/resume your remaps. It can also open the accessibility settings on the device to enable/disable the service. Rooted devices can start/stop the accessibility service without going into settings and just tap the notification.
  • Use Material Design 2 for homescreen.

Bug fixes
  • Persistent notifications wouldn't show on boot
  • The app would crash if using the "open google assistant" action if the Google app wasn't installed.
  • Prevent the accessibility service from stopping if there is a fatal exception and show a toast when it happens.

1.0.0 Beta 6
  • Changed developer email.
  • Added link to the XDA Thread in the About activity.
The Following 2 Users Say Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
23rd March 2019, 06:38 AM |#3  
Senior Member
Thanks Meter: 30
 
More
is it possible to remap the play / pause button of the bluetooth headset to start Assistant?where is the download?
23rd March 2019, 10:05 AM |#4  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by dario2106

is it possible to remap the play / pause button of the bluetooth headset to start Assistant?where is the download?

I haven't tried using buttons on a Bluetooth headset but I have tried using the buttons on a wired headset and it does work. Most buttons should work as long as they don't have a proprietary implementation in the Android skin you're using. E.g Bixby, Pixel Active Edge. XDA doesn't allow new members to put links in posts until they have posted 10 times for security reasons. Once I can, I will definitely put links in the description.
The Following User Says Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
23rd March 2019, 10:07 AM |#5  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by dario2106

is it possible to remap the play / pause button of the bluetooth headset to start Assistant?where is the download?

https://forum.xda-developers.com/and...apper-t3914005

Here is the link to the app on XDA labs
The Following User Says Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
23rd March 2019, 10:10 AM |#6  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by sds100

I haven't tried using buttons on a Bluetooth headset but I have tried using the buttons on a wired headset and it does work. Most buttons should work as long as they don't have a proprietary implementation in the Android skin you're using. E.g Bixby, Pixel Active Edge. XDA doesn't allow new members to put links in posts until they have posted 10 times for security reasons. Once I can, I will definitely put links in the description.

Update: I can add links on mobile completely fine.
The Following User Says Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
24th March 2019, 11:26 AM |#7  
Senior Member
Thanks Meter: 1,185
 
More
Nice! Will map a button to a broadcast intent be implemented?
24th March 2019, 12:06 PM |#8  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by Droidphilev

Nice! Will map a button to a broadcast intent be implemented?

Yeah! Great idea. I've added it to the "issues" on the GitHub repo. I have exams coming up so it will probably be a couple months.
The Following User Says Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
24th March 2019, 05:11 PM |#9  
Member
Thanks Meter: 15
 
More
It would be great if you could add the possibility to force close the app in use! Thanks and keep up the work!
24th March 2019, 07:15 PM |#10  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by articuz

It would be great if you could add the possibility to force close the app in use! Thanks and keep up the work!

Thanks! That's now been added to the planned features. Would you say the app is stable enough to come out of beta?
The Following User Says Thank You to sds100 For This Useful Post: [ View ] Gift sds100 Ad-Free
27th March 2019, 09:38 PM |#11  
sds100's Avatar
OP Member
Thanks Meter: 33
 
More
New version!

1.1.0 Beta 1
Added
  • Setting to change the long-press delay.
  • Persistent notification which can pause/resume your remaps. It can also open the accessibility settings on the device to enable/disable the service. Rooted devices can start/stop the accessibility service without going into settings and just tap the notification.
  • Use Material Design 2 for homescreen.

Bugs Fixed
  • Persistent notifications wouldn't show on boot
  • The app would crash if using the "open google assistant" action if the Google app wasn't installed.
  • Prevent the accessibility service from stopping if there is a fatal exception and show a toast when it happens.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes