Remapping Dock Keys (alt/search swap + back-> escape + screenshot -> camera) - Asus Transformer TF700

I finally rooted my device after 2 years... lol. I love the dock, but it always bugged me that the search button was were you normally would find alt and the back key wasn't escape. It made doing alt+tab and using escape in terminal really difficult. Here's a guide on how to remap all these 4 buttons on the hardware dock keyboard for the transformer infinity. I think this probably will work with the prime and other transformer docks as they seem to have all the same key codes. All you need is root and to follow this guide and you can customize almost anything you'd like.
Remapping Screenshot Key to Camera Key
Who needs a screenshot key?? I think it'll be more useful as a camera key. Unfortunately, this is a custom program that handles all the special keys on the top of the keyboard (wireless on/off, bluetooth, etc.). I had to edit the source and recompile this to get the camera button to work. No guarantee that it will work for you as you will need to compile custom code, but you can use my file. I compiled it for Zombi-Pop 5.1.1.
org.omnirom.asusdec.jar
Download that file to your tablet. Open a Terminal up and remount /system as read-writeable.
Code:
mount -o remount,rw /system
Back up your current /system/framework/org.omnirom.asusdec.jar and then overwrite it with the new file.
Reboot and your screenshot button now should launch the camera!
Remapping Other Keys
Remapping the standard keys is much easier to do. All you have to do is edit a .kl (keyboard layout) file. You can use my .kl file or modify it to your own liking. Here is my .kl file:
asusdec.kl
#1. remount /system as read-writable. Refer to above.
#2. Backup /system/usr/keylayout/asusdec.kl if you have that file.
#3. Upload the new asusdec.kl to /system/usr/keylayout/asusdec.kl.
#4. (optionally) open the file and edit it to your heart's content.
#5. Reboot and enjoy your new key layout.

Can you remap the browser key to open another browser other than stock?

Related

Native console in recovery mode

I've been working on adding an actual console for recovery mode. I've got it to the point where it's ready for a beta release. Feel free to download it and try it out, and let me know what you think
I'm not including a update.zip for this for now. You'll need to extract the recovery.img file from RecoveryConsole_Beta.zip, and flash it in any of the usual ways (flash_image, fastboot flash, copy to /data/recovery.img)
If you just want to try it out without actually flashing it onto your phone, you can use "fastboot boot recovery.img".
Here is a list of the special keys that are currently defined:
Code:
ctrl search
caps lock menu (on the keyboard)
arrow keys call + w,a,s,d
change virtual console call + 1,2,3...0
scroll console home + w,s
page up menu (above the trackball) + w
page down menu (above the trackball) + s
home menu (above the trackball) + a
end menu (above the trackball) + d
escape back
reboot menu (above the trackball) + search + backspace
Interesting. Is that the Debian/Android unionfs environment I spot there?
jashsu said:
Interesting. Is that the Debian/Android unionfs environment I spot there?
Click to expand...
Click to collapse
Debian yes. unionfs no. I just have it chroot into the debian environment.
Ah, you're right. Going to take this for a spin a little later when i'm done working. Another cool hack! Great job
p.s. I notice you've got nano open there. Is the environment capable of supporting any text-based binary compiled for armel?
jashsu said:
Ah, you're right. Going to take this for a spin a little later when i'm done working. Another cool hack! Great job
p.s. I notice you've got nano open there. Is the environment capable of supporting any text-based binary compiled for armel?
Click to expand...
Click to collapse
The nano is in my debian environment of course. But yeah, most anything text-based should run, afaik.
Hmm... menu (kb) + bs + search isn't rebooting for me. Any ideas?
Sorry, my mistake. it's the menu above the trackball, not the one on the keyboard.
Hmm.. strange. I had tried menu(trackball) + bs + search too but it didn't initially work. After reading your reply I mashed it a few more times and it rebooted. I guess the tolerance for a simultaneous keypress is tight.
Anyway, great fun hack. =D
Realy cool!
What about add a 'keyshelp' command to print the special keys?
any major changes from the version you sent me other than the 'e' in console?
keatonreckard said:
any major changes from the version you sent me other than the 'e' in console?
Click to expand...
Click to collapse
A few changes in the keymap, less memory taken up by the unused virtual terminals. probably a few other things I'm forgetting
Any development?
Recovery Image Build
Hello
Thanks for providing this.
I am not able to build recovery.img .i am able to see out/target/product/generic/system/bin/recovery. what is the procedure to build recovery.img what are the instruction i need to follow. i just ran make recovery.

[WIP][MOD]App Switcher Shortcut on Keyboard Dock

Edit - Aug-19-2011 - This works as of Android 3.2, but it brings up the old style (non-honeycomb) recent apps list. This is apparently what Asus has Alt-Tab mapped as now.
Edit - the dev section might not be the appropriate place for this. Feel free to move.
I'm trying to find a way to map a keyboard key to the recent apps multitasking menu, but I'm not having any luck. 'APP_SWITCH' would appear to be the proper keycode (see here) but there is no effect after making the necessary edit in the key layout map (/system/usr/keylayout/asusec.kl). I can successfully change keys to other functions (I tested by remapping GRAVE - aka the accent mark ` - to HOME), but I'm unable to pull up the app switcher. Anybody else have any luck?
I started putting together a write-up based on another thread (thanks shograt) but modified for the TF's mount points, filesystem, and key map file:
- # adb pull /system/usr/keylayout/asusec.kl
-- edit 'asusec.kl' with your text editor of choice. If you're on Windows, I've heard Notepad++ is a good choice.
-- Change the keycode to 'APP_SWITCH' (NOT working) for the key of your choosing. More info on key defintion formats here: http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html#androidKeymapKeyLayoutMapTitle
- # adb shell
-- NOTE - verify mount point using cat /proc/mounts
- # mount -o rw,remount -t ext4 /dev/block/mmcblk0p1 /system
- # exit
- # adb push asusec.kl /system/usr/keylayout
- # adb shell
- # cd /system/usr/keylayout
- # chmod 644 asusec.kl
- # cd /
- # mount -o ro,remount -t ext4 /dev/block/mmcblk0p1 /system
- # exit
- # adb reboot
im surprised this has had no replies....this is something we really need
cmon guys, lets figure this out
this would be great!
i think it would good to see also
I too have found myself needing a window switcher key on the keyboard, it just makes sense, or at least an "alt-tab" function.
I'm another person who would love to have a recent apps key!
I wish asus had dropped that left Fn key for a recent apps key, makes so much more sense.
could the app 'Tasker' be used to acheive this?
Yes excellent idea, and maybe someone can come up with a way to remap the shortcut/keys to allow you have your own browser shortcut used instead on the default one, for one example
I'm not sure that the function is actually available to map to a physical keyboard at the moment. From google's docs:
public static final int KEYCODE_APP_SWITCH
Key code constant: App switch key. Should bring up the application switcher dialog.
Constant Value: 187 (0x000000bb)
Click to expand...
Click to collapse
Notice the 'Should' comment (emphasis added). None of the other keys have ambiguous language like that.
Also, using KeyEvent Scanner (from the market) doesn't return anything when the on-screen app switcher button is pushed. I didn't see anything in logcat either, but I didn't take a very close look. I'm out of ideas for now.
+1 for this, hopefully resurrecting this thread will reignite some dev'in
My plan was to edit the .kl file to map my wireless key (right beside Back/ESC) to Recent Apps...very strange too that Google has placed such an emphasis on 'should' in the docs...maybe 3.2 is more reliable at this??
Cheers
Haven't looked at this in a long time. Alt-Tab works now, so I guess that does the job though.
You're right! It will suffice I guess, but a one button hit would be best no doubt Funny because I thought it wouldn't work for me, but I first tested it while I was in Firefox. It still does not work while using Firefox, but in all other apps, it works.
To be greedy, it'd also be nice if CTRL+left/right arrow key jumped the carat to the beginning of words
Thanks for the ALT-TAB tip too bedoig!
I spent so long looking into keychars and keylayouts with a bluetooth keyboard on a Motorola Xoom. I went through and remapped a whole bunch of things - one of which was indeed APP_SWITCH.
It didn't do anything on 3.0 and 3.1, BUT when I updated to 3.2, it started magically working. I'm assuming that the same thing would happen here, though I haven't tried. Also, you could pull off remapping keys without adb if you buy root explorer. That way you can navigate to the files on your tablet and edit them directly.
I'd love to be able to change the "search" button to an app switch key.... but I don't know enough to do what the above suggests at the moment.
N/M, outdated...
Esoth said:
I spent so long looking into keychars and keylayouts with a bluetooth keyboard on a Motorola Xoom. I went through and remapped a whole bunch of things - one of which was indeed APP_SWITCH.
It didn't do anything on 3.0 and 3.1, BUT when I updated to 3.2, it started magically working. I'm assuming that the same thing would happen here, though I haven't tried. Also, you could pull off remapping keys without adb if you buy root explorer. That way you can navigate to the files on your tablet and edit them directly.
Click to expand...
Click to collapse
What do you know, it works! I was hoping it would activate the recent apps list you get when using the on-screen button rather than the alt-tab Android 2.x style pop-up, but oh well.
I really hope this changes when ICS comes along!
bedoig said:
Edit - Aug-19-2011 - This works as of Android 3.2, but it brings up the old style (non-honeycomb) recent apps list. This is apparently what Asus has Alt-Tab mapped as now.
Click to expand...
Click to collapse
sorry if i could help i would good luck hope you get it figured out.

Ice Cream Sandwich Bluetooth Keyboard Shortcuts

Does anyone know where to find out all the shortcuts you can do with an external keyboard on Android 4.0? Things like the back button, home screen, etc. Thank.
Thread Necromancy, I know, but this is a serious question that remains unanswered. Here's the most info I've found:
Rootzwiki User Gr8gorilla posted a list of shortcuts that work with his Targus Bluetooth Keyboard (I'm editing the list for formatting, and adding more as I find them.)
ESC: Back (woo!)
Targus FN + F* keys: (edit: These only work with the specific model of Targus keyboard. Your FN key may only perform functions as labelled, test it to verify)
FN+F1: Search
FN+F8: play/pause music
FN+F7: Skip Prev
FN+F9: Skip Next
FN+F11: Volume -
FN+F12: Volume +
FN+ESC: Wallpaper, manage apps, system settings.
Alt+Tab - recent apps, task switcher (WOO!)
CTRL + Alpha keys:
Ctrl+A: Market (edit: this opens the "add to home screen" menu for me)
Ctrl+P: Settings
Ctrl+W: Wallpaper
Ctrl+M: Apps
In Browser: (edit: these work in other apps too, if they apply)
Ctrl+B: Bookmarks
Ctrl+A: Select all
Ctrl+C: Copy
Ctrl+V: Paste
Ctrl+W: Close current tab
Ctrl+T: Open new tab
Command/Windows button + : (edit: these commands work from anywhere, even in other apps)
Win+E: Launch Default Email App (brings up a choice dialog if necessary)
Win+A: Launch Calculator.apk
Win+S: Launch Messaging.apk (SMS App)
Win+C: Launch Contacts
Win+B: Launch Browser.apk (not your default browser, unfortunately)
Win+P: Launch Music.apk (not your default music player, unfortunately)
Win+L: Launch Calendar
Win+M: Launch Google Maps
From my own experience: the above work, other than the Targus-specific ones. I've tested them all. I'm looking for more, especially ways to activate "HOME", "MENU" and to open/close the notification drawer.
Also, you can edit your /system/usr/keylayout/qwerty.kl to change which key codes sent by the bluetooth keyboard activate various functions. This would be a rather involved hack, and may be specific to your hardware. Doing it wrong could compromise your ability to use your software keyboard. Also, it would be replaced whenever you flash a ROM, and possibly some smaller updates as well. Here's a guide to hacking keyboard layouts, though it's a bit old, and I haven't tested it. DO AT YOUR OWN RISK, but post your results either way!
I'm looking for a way to enable the Android SDK Emulator Shortcut Keys on real devices. It would give us that which we're missing.
Ctrl+W and Ctrl+T
In the stock browser:
Ctrl+W - closes the current tab
Ctrl+T - opens a new tab
There may be more of these that are similar to chrome shortcuts but those are the only two I really use.
erupe said:
In the stock browser:
Ctrl+W - closes the current tab
Ctrl+T - opens a new tab
There may be more of these that are similar to chrome shortcuts but those are the only two I really use.
Click to expand...
Click to collapse
Tested to verify. Works in Chrome as well. Added to the list above!
Thanks for coming up with that list. Really appreciate it.
I'd just like to clarify something: using an app called KeyEvent Display, free on Google Play, you can verify that Android is actually receiving keystrokes from your keyboard. I've tested every key on my keyboard, and found that they correspond exactly with /system/usr/keylayout/Generic.kl (fn key excluded, because that's handled by the keyboard itself, not passed to the OS).
I think the Android Framework doesn't know what to do with:
F-Keys
Mute
wow nice one.

Editing android.policy.jar

I'm using CM9 5/2 version currently and seeking for a key remap.
A key user experience of ICS is multitasking but the 2 second delay on home button prevents me from using this function of Recent Apps. So I start to remap my search button to ics recent apps.
1: http://forum.xda-developers.com/showthread.php?t=1480887
[MOD][PORT]Search key to ICS recent apps for ICS Passion from Vibrant forum
2:http://forum.xda-developers.com/showthread.php?t=1450138
[HOWTO] Remap hardware button to ICS recent apps (which contains Java change instruction_
According to link2 I edited system/usr/keylayout/melfas_touchkey.kl and change search to recent apps, but it's not the ics style like long-press home button, it's gingerbread style recent apps. It seems to need some java change to support the change.
Among all the mods only link 1 make it work that search button->ICS recent apps. Link 1 provided excessive change and it mess the home button and power menu up. I deleted the key layout change part from Link 1 zip so the home button is fine, but how could I edit android.policy.jar in META-INF and system/framework?
Update May 17:
I finally decomplied the android.policy.jar into classes.dex, then I took out PhoneWindowManager.class and that's all I can see, can't edit it anymore.
Thanks
Troubleshooted installation failure problem, I simply copied the android.policy.jar to replace my old one and it's not working well either.. of cource not, any good idea?

Location "recent apps" button in .kl file

Hi, after determining the protocol to change the keyboard layout thanks to user birdie in this post, I remain unable to disable/remap my "recent apps" button in the navigation bar. (Another way to reach that goal would be the gravity box requires Xposed framework which is not yet compatible with my phone/firmware.)
For completeness:
Android 7.1.2
LineageOS version: 14.1-20180609-NIGHTLY-osprey
Phone: MotoG3.
In the original post referred to above, the recent button is said to be found in file
Code:
/system/usr/keylayout/synaptics_dsx.kl
However, that file does not exist (in that location) on my phone. The only two files that do exist are:
Code:
Generic.kl
AVRCP.kl
Hence I inspected both, and modified Generic.kl to
Code:
key 580 BACK VIRTUAL
key 581 HOME VIRTUAL
key 582 HOME VIRTUAL
So to be explicit, I remapped the "recent apps" button mapping, to home. However, it does not have any effect, neither after rebooting. Therefore, I have the following question:
Does anyone know in which file and under which key number the "recent apps" button is mapped, for the phone as detailed above?
Kind regards

Categories

Resources