[ROOT] Remap Bixby Button w/o an app

squabbi

Senior Member
Jul 20, 2012
1,742
1,596
143
Sydney
thanks so much for the info - but i'm getting an error message saying access denied when trying to rename the generic.kl file?
Depending on the file manager you use, you might need to find the menu option to enable R/W to the directory or to '/'.

You might not also need to rename the file, see if you can open it as a text file with your file manager's built in editor.

Sent from my SM-G955F using Tapatalk
 

SixFourSix

Senior Member
Mar 27, 2016
343
139
0
This thread is extremely useful and this finding is probably the nicest "mod" we have for S8, IMO at least. But after some time, Samsung will find this and break the feature to force us use the ****ty Bixby.

I wish we could hide this, but I also wish every rooted user finds this thread. Such a two-edged sword.. :)
 
  • Like
Reactions: josegon30

j91co

New member
Jun 17, 2017
4
2
0
Back button key name? And camera ?
ANY key name is easily gained by web search, look for generic.kl + keyword(s). Or just search the text in the generic.kl file. If it could ever be some type of hardware key on a mass produced product you will likely find it (i.e. game control pad, bluetooth keyboard, etc.)

Back Button - key 158 BACK

Camera - key 212 CAMERA

---------- Post added at 02:16 AM ---------- Previous post was at 02:07 AM ----------

This thread is extremely useful and this finding is probably the nicest "mod" we have for S8, IMO at least. But after some time, Samsung will find this and break the feature to force us use the ****ty Bixby.

I wish we could hide this, but I also wish every rooted user finds this thread. Such a two-edged sword.. :)
Definitely from a very novice user...but it seems like even among android variants like the Galaxy series, the hard key(s) are reasonably searchable or just easy enough to search manually within the generic.kl file itself, until Samsung deviates from android functionality enough there should be a "little" predictable wiggle room (on rooted devices.) Though again, my POV is as a user very new to making changes outside a tutorial...

---------- Post added at 02:25 AM ---------- Previous post was at 02:16 AM ----------

Anyone have a way to use this method with Tasker yet?
The rudimentary way I use this with tasker is via "Tasker App Factory", I make an app out of the task I want to use then tie it to the Bixby button using the method described in post #99 (below.) I successfully use this method to activate specific smart home functionalities with my Vera unit.


After much experimenting I figured out (stumbled onto) how to assign the Bixby button to any app by combining methods, it's definitely an inelegant solution but it worked for my ends. I used the approach as described here combined with use of the All in one Gestures app that was previously viable on it's own until an early patch from Samsung made the it unable to register the Bixby button press.


1. Follow the steps as described in this thread, but choose a key-code that is unlikely to be used in daily use and assign it to the Bixby button (703). I have successfully used F24, Search and DVR.

2. Install the app "All in one Gestures" from Google Play.

3. Open All in one Gestures, tap the "More" menu in the upper right corner and choose "Custom Keys"

4. Pressing the Bixby button should now register as whatever key-code you assigned in generic.kl, add it and you are free to assign any function that the app allows.
 

SixFourSix

Senior Member
Mar 27, 2016
343
139
0
Definitely from a very novice user...but it seems like even among android variants like the Galaxy series, the hard key(s) are reasonably searchable or just easy enough to search manually within the generic.kl file itself, until Samsung deviates from android functionality enough there should be a "little" predictable wiggle room (on rooted devices.) Though again, my POV is as a user very new to making changes outside a tutorial...
Yeah I hope it'll be like this. I was just thinking if Samsung will find a way to implement the button some other way.. but yeah, I see they maybe change the keycode number or description, which would be easily comparable to this original file (Generic.kl) we have now.
 

SixFourSix

Senior Member
Mar 27, 2016
343
139
0
I wonder if there's a specific keycode also for double tapping or long pressing volume keys (or Bixby)

Would be neat if these also could be customized..
 

DarkXoa

Member
Jun 27, 2014
14
3
23
Athens, GA
So I tried this and several things broke. I tried going back to my backup, but no luck. Hardware buttons are broken. Anyone know if I can get into download mode with it like this? I'm afraid to turn my phone off for fear that the buttons still won't work, and it'll forever be a paperweight.

EDIT: Well, I found out by accident that the buttons still work when the phone is turned off. Was getting frustrated and held the lock button down and ended up in upload mode. Scared the **** outta myself, but I got it back on. Gonna wipe it and start over later. Won't be the first time I've done so recently. With my luck it won't be the last either.

By the way, I'm also on the SM-G955U. Not sure why it got screwed so hard for me. Maybe it didn't like the text editor I used? I didn't have any problems with permissions.
 
Last edited:

shakan09

Senior Member
Jan 24, 2012
59
17
0
So I tried this and several things broke. I tried going back to my backup, but no luck. Hardware buttons are broken. Anyone know if I can get into download mode with it like this? I'm afraid to turn my phone off for fear that the buttons still won't work, and it'll forever be a paperweight.

EDIT: Well, I found out by accident that the buttons still work when the phone is turned off. Was getting frustrated and held the lock button down and ended up in upload mode. Scared the **** outta myself, but I got it back on. Gonna wipe it and start over later. Won't be the first time I've done so recently. With my luck it won't be the last either.

By the way, I'm also on the SM-G955U. Not sure why it got screwed so hard for me. Maybe it didn't like the text editor I used? I didn't have any problems with permissions.
use the built in text editor in root explorer and make sure you rename the file back to generic.kl not .txt
 

x5c0d3

Senior Member
Nov 27, 2011
102
28
0
Anyone know if I can get into download mode with it like this?
If you have USB Debugging active and adb, just type
Code:
adb reboot recovery
after connecting your phone with your computer.

---------- Post added at 12:24 PM ---------- Previous post was at 12:14 PM ----------

Lazy as I am, I created some few shell commands to map the Bixby button to Google Assistant. You may use this at own risk and change VOICE_ASSIST to what you like.
Code:
adb shell
su # don't forget to allow root for the shell now
mount -o rw,remount /system # Mount system partition as Read/Write
cd /system/usr/keylayout
mv Generic.kl Generic.kl.bak # Backups are always a good idea
sed 's/WINK/VOICE_ASSIST/' Generic.kl.bak > Generic.kl # Replace Bixby with Google Assistant
grep 703 /system/usr/keylayout/Generic.kl # Check if it got changed correctly
mount -o ro,remount /system # Back to Readonly just to be sure
reboot # Activate the change
 

squabbi

Senior Member
Jul 20, 2012
1,742
1,596
143
Sydney
If you have USB Debugging active and adb, just type
Code:
adb reboot recovery
after connecting your phone with your computer.

---------- Post added at 12:24 PM ---------- Previous post was at 12:14 PM ----------

Lazy as I am, I created some few shell commands to map the Bixby button to Google Assistant. You may use this at own risk and change VOICE_ASSIST to what you like.
Code:
adb shell
su # don't forget to allow root for the shell now
mount -o rw,remount /system # Mount system partition as Read/Write
cd /system/usr/keylayout
mv Generic.kl Generic.kl.bak # Backups are always a good idea
sed 's/WINK/VOICE_ASSIST/' Generic.kl.bak > Generic.kl # Replace Bixby with Google Assistant
grep 703 /system/usr/keylayout/Generic.kl # Check if it got changed correctly
mount -o ro,remount /system # Back to Readonly just to be sure
reboot # Activate the change
Wouldn't download mode be: `adb reboot bootloader` or `adb reboot download`, which is the command that some newer HTC devices use?

Sent from my SM-G955F using Tapatalk
 

x5c0d3

Senior Member
Nov 27, 2011
102
28
0
Wouldn't download mode be: `adb reboot bootloader` or `adb reboot download`, which is the command that some newer HTC devices use?
From the adb help
Code:
 reboot [bootloader|recovery|sideload|sideload-auto-reboot]
     reboot the device; defaults to booting system image but
     supports bootloader and recovery too. sideload reboots
     into recovery and automatically starts sideload mode,
     sideload-auto-reboot is the same but reboots after sideloading.
 

Flashman2000

Member
Aug 9, 2017
28
20
0
Katy
Just tried remapping my s8 plus with root. Upon reboot my hardware buttons don't work. How can I reboot phone to fix the problem
Make sure u set your permission to rw-r-r

---------- Post added at 07:53 AM ---------- Previous post was at 07:50 AM ----------

So I tried this and several things broke. I tried going back to my backup, but no luck. Hardware buttons are broken. Anyone know if I can get into download mode with it like this? I'm afraid to turn my phone off for fear that the buttons still won't work, and it'll forever be a paperweight.

EDIT: Well, I found out by accident that the buttons still work when the phone is turned off. Was getting frustrated and held the lock button down and ended up in upload mode. Scared the **** outta myself, but I got it back on. Gonna wipe it and start over later. Won't be the first time I've done so recently. With my luck it won't be the last either.

By the way, I'm also on the SM-G955U. Not sure why it got screwed so hard for me. Maybe it didn't like the text editor I used? I didn't have any problems with permissions.
Had the same issue. Solved by setting generic.kl permissions to rw--r--r. Make sure u remap using the correct commands or none of ur hardware buttons will work.