[HowTo]F1-F12 function and Delete keys on dock kbd in Ubuntu - Eee Pad Transformer Q&A, Help & Troubleshooting

Several weeks ago I installed Tubuntu on my TF101 (Thanks x3maniak, lilstevie and other guys for fantastic work)
But I was in want of F1-F12 function and Delete keys on dock-kbr.
I solved that with xmodmap
Step 1: dump current keymod map table to .Xmodmap file in user directory
Code:
$ xmodmap -pke > /home/user/.Xmodmap
Step 2: edit .Xmodmap
open in your favorite text editor
And change keycode 246 stroke to "keycode 246 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1 F1"
keycode 245 stroke to "keycode 245 = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2 F2"
For other F-keys you will edit these strokes on given example:
F3 = keycode 68
F4 = keycode 224, keycode 232, keycode 237
F5 = keycode 225, keycode 233, keycode 238
F6 = keycode 69
F7 = keycode 220
F8 = keycode 158
F9 = keycode 70
F10 = keycode 173
F11 = keycode 172
F12 = keycode 171
For Delete I used 'Lock' btn and remapped "keycode 150 = Delete NoSymbol Delete"
Two words about F4, F5. The Brightness Up and Down keys didn't give results in 'xev' program and I changed all Brightness related keys in the file.
Step 3: reboot
It's strange, but xmodmap ~/.Xmodmap didn't affect on keymod table
Example file in attachment, but It was made for Russian (Cyrillic) -English kbd layouts

Related

Hold a button to start a program

Hello, i want to custom the HTC'Button
I don't know how to do that, but i know it's in Base register
For ComManager i know it's
Code:
HKLM\Microsoft\Shell\Keys\40C6
default = \Window\CommManagerLink.exe (pour l'exemple) (String Value)
Flags = 0 (DWORD Value)
Icon = \windows\SendKeyIcon.exe, 0 (String Value)
Name = Send key(Hold) (String Value)
And it work
and now i want to start TaskManager with the windows button...
Please help me! Sorry about my English
Just use AE Button Plus.
The easiest and the best.

[REQ] Adjusted autobrightness app/hack

Could someone write either
1) Autobrightness adjuster (to set which values autobrightness uses),
or
2) Make a modified autobrightness file with the following values,
Sensor = Brightness
10 = 50
160 = 60
225 = 70
320 = 80
640 = 115
1280 = 145
2600 = 185
10240 = 255
Thanks.
P.S. This is for the latest OTA or, preferably, for myn rls2 rom.
Anybody?
----------

[XT720] Remapping the Hardware MEDIA button (next to camera button)

hey guys, I want to remap the hardware MEDIA key (the one next to the camera/focus button) on my xt720, but I cannot seem to find it in qwert.kl or any other files. I have successfully remapped any of the 4 touch-sensitive keys (home, menu, back, search) and the camera/focus key as well, but I can't figure out what the media key is. if anyone have any idea please let me know
I want to change the Media key to turn on and off the autofucus LED to use it as a flashlight on off switch.\
This is what i have been able to find so far.\
http://forum.xda-developers.com/showthread.php?t=939644&page=130
Looks promising...
I think this thread should be moved to DEV.
hellmonger said:
I want to change the Media key to turn on and off the autofucus LED to use it as a flashlight on off switch.\
This is what i have been able to find so far.\
http://forum.xda-developers.com/showthread.php?t=939644&page=130
Looks promising...
I think this thread should be moved to DEV.
Click to expand...
Click to collapse
What's strange is that if you look at the qwerty.kl from Motorola for eclair on the XT720 and froyo on the Korean XT720 they are identical--but both MODE_CHANGE and 112 are not included. Dexter's copy with the MODE_CHANGE and 112 comes from the leaked froyo Milestone A85x. They've been on my radar as files that never change and remain constant over all Motoroi and XT720 releases, but that were changed in Dexter's ROM.
Mioze7Ae said:
What's strange is that if you look at the qwerty.kl from Motorola for eclair on the XT720 and froyo on the Korean XT720 they are identical--but both MODE_CHANGE and 112 are not included. Dexter's copy with the MODE_CHANGE and 112 comes from the leaked froyo Milestone A85x. They've been on my radar as files that never remain constant over all Motoroi and XT720 releases, but that were changed in Dexter's ROM.
Click to expand...
Click to collapse
Yeah i noticed that to.... i think that 112 is incorrect. Just some speculation here but i think the issue is in the framework... need to modify it for the correct key to be recognized....
!!!!!REQUEST HERE!!!!!
If anyone is stuck re-flashing original stock 2.1.1 please run this https://github.com/chrisboyle/keytest/downloads
Also please validate if you have /system/usr/keylayout/sholestabletp3str-keypad.kl and paste output of that file.
I think i might be on to something here...
Well, when we set keycode 112 and other action, like media_next e.t.c. we get what action is must do.
fjfalcon said:
Well, when we set keycode 112 and other action, like media_next e.t.c. we get what action is must do.
Click to expand...
Click to collapse
Where you able to get 112 to do anything?
I think I accidentally an important word there. Just to clarify in case of confusion I meant
Mioze7Ae said:
They've been on my radar as files that never change and remain constant over all Motoroi and XT720 releases, but that were changed in Dexter's ROM.
Click to expand...
Click to collapse
in qwerty keymap.
xavwanted do such thing in his mod.
Sent from my XT720 using XDA App
From 2.1 Russian Rom:
Menu key:
Keycode: 82
KeyEvent: KeyEvent{action=0 code=82 repeat=0 meta=0 scancode=139 mFlags=72}
Back key:
Keycode: 4
KeyEvent: KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=72}
Search key:
Keycode: 84
KeyEvent: KeyEvent{action=0 code=84 repeat=0 meta=0 scancode=217 mFlags=72}
Gallery key:
Keycode: 92
KeyEvent: KeyEvent{action=0 code=92 repeat=0 meta=0 scancode=112 mFlags=8}
Camera shutter key:
Keycode: 80
KeyEvent: KeyEvent{action=0 code=80 repeat=0 meta=0 scancode=211 mFlags=8}
Volume Up key:
Keycode: 24
KeyEvent: KeyEvent{action=0 code=24 repeat=0 meta=0 scancode=115 mFlags=8}
Volume Down key:
Keycode: 25
KeyEvent: KeyEvent{action=0 code=25 repeat=0 meta=0 scancode=114 mFlags=8}
Click to expand...
Click to collapse
As we can see - scancode for keycode 92 - 112...
And that sholestabletp3str_keypad
fjfalcon said:
From 2.1 Russian Rom:
As we can see - scancode for keycode 92 - 112...
And that sholestabletp3str_keypad
Click to expand...
Click to collapse
So this sholestabletp3str-keypad.kl is the original from 2.1.1?
Also i would need to get my hands on sholestabletp3str-keypad.bin in /system/usr/keychars/
I love it when a plan comes together
Yes, it's original.
hellmonger said:
So this sholestabletp3str-keypad.kl is the original from 2.1.1?
Also i would need to get my hands on sholestabletp3str-keypad.bin in /system/usr/keychars/
I love it when a plan comes together
Click to expand...
Click to collapse
Here are all the /system/usr/keychars and /system/usr/keylayouts from
SHOLS_U2_02.36.0 (Milestone eclair)
SHOLS_U2_05.26.0 (Milestone froyo)
STR_U2_01.1E.0 (XT720 eclair UK)
STR_U2_04.1E.1 (XT720 eclair US/CBW)
STSKT_N_79.11.39R (Motoroi eclair)
STSKT_N_79.33.50R (Motoroi froyo)
stock221v13 (Dexter froyo)
Mioze7Ae said:
Here are all the /system/usr/keychars and /system/usr/keylayouts from
SHOLS_U2_02.36.0 (Milestone eclair)
SHOLS_U2_05.26.0 (Milestone froyo)
STR_U2_01.1E.0 (XT720 eclair UK)
STR_U2_04.1E.1 (XT720 eclair US/CBW)
STSKT_N_79.11.39R (Motoroi eclair)
STSKT_N_79.33.50R (Motoroi froyo)
stock221v13 (Dexter froyo)
Click to expand...
Click to collapse
PERFECT!!! Ok il get right on this...
OK!
So i am able to get the autofucus LED to light up by pressing the Media key!!!!
.
BUT!
only with the camera app open..
I have to keep it pressed to keep the light on i would need to speak to the guy that wrote that APK for LightXT im sure we could get something going here...
see the problem is basically the app runs the command echo 1 > /sys/class/leds/af-led/brightness and echo 0 > /sys/class/leds/af-led/brighness when pressing the button but more complex. which requires root for some reason. if there is way to map the key to run the command it might work. unless someone can create a script that runs when the button is pressed that has that command. my brother the creator of the app doesnt think its possible to map the key to the light on and off but we can try he has a droid x so he cant really try out things with out me being there.
easye420 said:
see the problem is basically the app runs the command echo 1 > /sys/class/leds/af-led/brightness and echo 0 > /sys/class/leds/af-led/brighness when pressing the button but more complex. which requires root for some reason. if there is way to map the key to run the command it might work. unless someone can create a script that runs when the button is pressed that has that command. my brother the creator of the app doesnt think its possible to map the key to the light on and off but we can try he has a droid x so he cant really try out things with out me being there.
Click to expand...
Click to collapse
So this is great!!!!
make a entry that is something like
IF = echo 0 > /sys/class/leds/af-led/brightness THEN DO echo 1 > /sys/class/leds/af-led/brightness
If = echo 1 > /sys/class/leds/af-led/brightness THEN DO echo 0 > /sys/class/leds/af-led/brightness
Is this possible? i bet extensive framework modification is required...
Maybe making an app that translates the media keys request? some that will read state of /sys/class/leds/af-led/brightness that should be possible!!!!
hellmonger said:
So this is great!!!!
make a entry that is something like
IF = echo 0 > /sys/class/leds/af-led/brightness THEN DO echo 1 > /sys/class/leds/af-led/brightness
If = echo 1 > /sys/class/leds/af-led/brightness THEN DO echo 0 > /sys/class/leds/af-led/brightness
Is this possible? i bet extensive framework modification is required...
Maybe making an app that translates the media keys request? some that will read state of /sys/class/leds/af-led/brightness that should be possible!!!!
Click to expand...
Click to collapse
It should be easy to make a setuid binary that toggles the value each time you press the button. Can you set the button to call a unix binary or do you have to cover it with java?
Mioze7Ae said:
It should be easy to make a setuid binary that toggles the value each time you press the button. Can you set the button to call a unix binary or do you have to cover it with java?
Click to expand...
Click to collapse
Can you map button presses directly to executables? Here's a suid binary that toggles the light. For example, put it in /system/xbin/toggle-af-led and
Code:
chown 0:0 /system/xbin/toggle-af-led
chmod 6755 /system/xbin/toggle-af-led
Then every time you run /system/xbin/toggle-af-led the light will toggle on or off. It shouldn't be too hard to wrap this in the framework if necessary. I had to do that for the extended power controls to create the /cache/.boot_to_or file.
Source
Code:
#include <stdio.h>
#include <unistd.h>
int main()
{
FILE* fid;
char c;
setuid( 0 );
fid = fopen("/sys/class/leds/af-led/brightness", "r");
fread(&c, 1, 1, fid);
fclose(fid);
if (c == '0')
c = '1';
else
c = '0';
fid = fopen("/sys/class/leds/af-led/brightness", "w");
fwrite(&c, 1, 1, fid);
fclose(fid);
return 0;
}
Mioze7Ae said:
Can you map button presses directly to executables? Here's a suid binary that toggles the light. For example, put it in /system/xbin/toggle-af-led and
Code:
chown 0:0 /system/xbin/toggle-af-led
chmod 6755 /system/xbin/toggle-af-led
Then every time you run /system/xbin/toggle-af-led the light will toggle on or off. It shouldn't be too hard to wrap this in the framework if necessary. I had to do that for the extended power controls to create the /cache/.boot_to_or file.
Source
Code:
#include <stdio.h>
#include <unistd.h>
int main()
{
FILE* fid;
char c;
setuid( 0 );
fid = fopen("/sys/class/leds/af-led/brightness", "r");
fread(&c, 1, 1, fid);
fclose(fid);
if (c == '0')
c = '1';
else
c = '0';
fid = fopen("/sys/class/leds/af-led/brightness", "w");
fwrite(&c, 1, 1, fid);
fclose(fid);
return 0;
}
Click to expand...
Click to collapse
OMFG!!!! you rock so hard!!!
Il work on this when i get home
Fiiiiiiiiiiiiiiiiiiiiinally im home!!!!!!!!!!
Ok moar woark!!!
i had an idea... X had previously re-mapped this button to something else... maybe he has an idea....
Im inviting X in on this too

[root]Alternative keyboard layout compilation

Hi there,
as this phone isn't available outside of the US I guess it's convenient for us importers to have some keyboard layouts to choose from. I just made a german one - I've made a list with those layouts which were already mentioned somewhere in this forum.
German Layout
Download keypad files here
Code:
My changes:
- AT is now the Umlaut special character (eg. press AT, then 'a' to get 'ä')
- AT is bound to the EMAIL key (EMAIL + A/U/O for umlauts works pretty well)
- SEARCH is bound to the CONTACTS key
- ALT is also bound to the VOICESEARCH key
- Y is Z; Z is Y
- ALT + B will now result in 'ß'
I just got used to two ALT buttons (coming from the DZ/G2). The SEARCH button is used in some apps, but not very often.. I like to have it on my keyboard, thus binding it to the CONTACTS key (I use search+'x' for certain shortcuts).
Nordic layout
user032 said:
Here's a Nordic layout I'm using. It should cover Swedish and Finnish characters. The keymaps have been shamelessly ripped off Desire Z CyanogenMod configuration files.
Email = Ö
Messaging = Ä
Voice Search = Å
sec_keypad.kl:
Code:
# Problem Children
key 155 BUTTON_4 WAKE_DROPPED
key 429 BUTTON_5 WAKE_DROPPED
key 217 BUTTON_3 WAKE_DROPPED
sec_keypad.kcm:
Code:
key BUTTON_3 {
label:'\u00C5'
base:'\u00E5'
shift, capslock:'\u00C5'
alt: '\u00E5'
shift+alt:'\u00C5'
}
key BUTTON_4 {
label:'\u00D6'
base:'\u00F6'
shift, capslock:'\u00D6'
alt: '\u00F6'
shift+alt:'\u00D6'
}
key BUTTON_5 {
label:'\u00C4'
base:'\u00E4'
shift, capslock:'\u00C4'
alt: '\u00E4'
shift+alt:'\u00C4'
}
Click to expand...
Click to collapse
jarrodlombardo's layout (Double [email protected]+DPAD_CENTER)
jarrodlombardo said:
Using the tips from http://forum.xda-developers.com/showpost.php?p=33762519&postcount=537 and some prior knowledge, I modified my keys so Irssi ConnectBot could work (it requires a DPAD_CENTER hard key) and some other things could be better.
If you replace your current versions with the below links, you'll get the following changes:
Shift + [number] gives the symbol Alt + [number] does.
The Email key will give you '@' and Alt + Email will give '~'. (This is how I had modified my Sidekick 4G's @ key since that kbd didn't have '~' at all.)
The stupid microphone button does DPAD_CENTER (this is the same as pressing the trackball button on phones that have them).
sec_keypad.kcm Put this in /system/usr/keychars/.
sec_keypad.kl Put this in /system/usr/keylayout/.
Click to expand...
Click to collapse
orange808's layout (multiple SEARCH keys)
orange808 said:
Sure. Here's my configuration:
http://www.mediafire.com/?tp3jc392w2q2jyg
The right shift key and the alt key are now search keys. This makes using quick launch keyboard shortcuts very easy because there are keys in both corners of the device to press--along with another key to launch an app. This eliminates the need to reach across the device when multitasking.
The voice key is now the right shift.
The sms/contacts and email buttons are now both alt keys.
It's not for everyone and most people will probably be confused with keys that perform strange actions (that conflict with their labels), but it works for me.
Click to expand...
Click to collapse
How to
(you need to mount the system partition as R/W to overwrite those files)
sec_keypad.kcm goes to /system/usr/keychars
sec_keypad.lk goes to /system/usr/keylayout
As written by dillalade in his post about keylayouts. Thanks to Nocturin for creating his information portal - which brought me there.
Feel free to upload your layout files / describe your changes - I'll add them to the list. They don't have to be language specific.
Just made some changes to my layout (added 'ß'), added two more (already mentioned) layouts.
Ctrl key.
Sory if this is not right section but I believe it is somehow related.
Is there a chance to add like or emulate key CTRL?
I was in shock when I get the mobile as was never thinking it is not present.
Regards
Mac
mazak23 said:
Sory if this is not right section but I believe it is somehow related.
Is there a chance to add like or emulate key CTRL?
I was in shock when I get the mobile as was never thinking it is not present.
Regards
Mac
Click to expand...
Click to collapse
Sure, since you can use normal keyboards with your android device there has to be some CTRL function - though I don't know why you'd want CTRL keys. There are some shortcuts in android which use CTRL similar to those windows has.. but I can't think of any other uses.
You just have to bind LEFT_CONTROL or RIGHT_CONTROL (in sec_keypad.kl) to any key you want. Haven't tested that though.
Kueber said:
Sure, since you can use normal keyboards with your android device there has to be some CTRL function - though I don't know why you'd want CTRL keys. There are some shortcuts in android which use CTRL similar to those windows has.. but I can't think of any other uses.
You just have to bind LEFT_CONTROL or RIGHT_CONTROL (in sec_keypad.kl) to any key you want. Haven't tested that though.
Click to expand...
Click to collapse
I want to use it for copy/paste options, we can do it on screen, but sometimes it's faster, and I prefer to do it with physical keyboard.
So do I have to root my device to change anything in that file, I am on 4.1.2 stock one now.
Thanks
Mac
Ah, I see - good idea actually, I'll try that.
Yes, you have to be rooted since you have to modify sytem files.
Sent from my SGH-T699
Kueber said:
Ah, I see - good idea actually, I'll try that.
Yes, you have to be rooted since you have to modify sytem files.
Sent from my SGH-T699
Click to expand...
Click to collapse
Recently I did ping in Shell apk and could't stop it, as without CTRL key I don't know how... So there is more than I said before.
Here's a Nordic layout I'm using. It should cover Swedish and Finnish characters. The keymaps have been shamelessly ripped off Desire Z CyanogenMod configuration files.
Email = Ö
Messaging = Ä
Voice Search = Å
sec_keypad.kl said:
# Problem Children
key 155 BUTTON_4 WAKE_DROPPED
key 429 BUTTON_5 WAKE_DROPPED
key 217 BUTTON_3 WAKE_DROPPED
Click to expand...
Click to collapse
sec_keypad.kcm said:
key BUTTON_3 {
label:'\u00C5'
base:'\u00E5'
shift, capslock:'\u00C5'
alt: '\u00E5'
shift+alt:'\u00C5'
}
key BUTTON_4 {
label:'\u00D6'
base:'\u00F6'
shift, capslock:'\u00D6'
alt: '\u00F6'
shift+alt:'\u00D6'
}
key BUTTON_5 {
label:'\u00C4'
base:'\u00E4'
shift, capslock:'\u00C4'
alt: '\u00E4'
shift+alt:'\u00C4'
}
Click to expand...
Click to collapse
Finally I made CONTROL key.
In file sec_keypad.kl I have now:
key 215 CTRL_LEFT
So instead of email key it is left control key.
I am so glad!
Now I am wondering how to add polish characters : ą, ć, ę, ł, ń, ó, ś, ź, ż
They should be under adequate letter and CTRL button (I believe).
Anybody can point me in the right direction?
Kueber said:
Hi there,
as this phone isn't available outside of the US I guess it's convenient for us importers to have some keyboard layouts to choose from. I just made a german one - I've made a list with those layouts which were already mentioned somewhere in this forum.
...
// edit: I forgot the 'ß', lol. I bound it to alt+B, since this button has no alt function + minor thread layout changes, added two more mappings which were mentioned in Nocturin's post
Click to expand...
Click to collapse
*I want to follow you with my layout but cannot found ß symbol in files you are posting.
Can you update files?
Thanks
mazak23 said:
*I want to follow you with my layout but cannot found ß symbol in files you are posting.
Can you update files?
Thanks
Click to expand...
Click to collapse
It's in the sec_keypad.kcm:
Code:
key B {
label: 'B'
number: '2'
base: 'b'
shift, capslock: 'B'
alt: '\u00df'
shift+alt, capslock+alt: '\u00df'
\u00df is unicode for 'ß'.
Kueber said:
It's in the sec_keypad.kcm:
Code:
key B {
label: 'B'
number: '2'
base: 'b'
shift, capslock: 'B'
alt: '\u00df'
shift+alt, capslock+alt: '\u00df'
\u00df is unicode for 'ß'.
Click to expand...
Click to collapse
Yeah , right.
Silly me, I was looking for S sharfe itself, it is unicode UTF 8?
Yup, UTF 8. DF is 223 in decimal. There are tables out there with all the special keys and their HTML-decimal value.
Here is polish keyboard layout.
Mainly we are getting special letters with CTRL button (which is under email key), but some are coming with left ALT. Thus because CTRL + C for example is COPY.
More explained in files.
Soon I will do it with right shift, which I see useless at all.
Pretty interesting this thread.
I just bought one of these best qwerty device masterpiece and I'm start wondering about how to make special CZECH characters under the numbers 2-0
I'd like this:
2 = ě
3 = š
4 = č
5 = ř
6 = ž
7 = ý
8 = á
9 = í
0 = é
Can you guys give me some guide? Many thanks in advance!
Is it no better to do it with alt or ctrl key?
Kueber wrote already instruction on next post.
There is one thing we should remember, permissions.
I experienced that when it is not right Android is using different file for keyboard layout (not using file sec_keypad.kcm).
I believe it is OK to use Root Explorer apk as it was mention somewhere.
Regards
xheretic said:
Pretty interesting this thread.
I just bought one of these best qwerty device masterpiece and I'm start wondering about how to make special CZECH characters under the numbers 2-0
I'd like this:
2 = ě
3 = š
4 = č
5 = ř
6 = ž
7 = ý
8 = á
9 = í
0 = é
Can you guys give me some guide? Many thanks in advance!
Click to expand...
Click to collapse
You have to modify the sec_keypad.kcm - just edit the keys.
For example, find the '2' key and edit the 'ě' in.. but you need to write it in UTF8.
1) Find character ascii value: ě -> 277 I believe (you can find those numbers in any ASCII chart <- this one even displays all the values in hex)
2) convert to HEX: 115
3) ě in unicode is now '\u0115' - just put the hex-number in like I did
4) edit the value in sec_keypad.kcm
Should look like this:
Code:
before
key 2 {
label: '2'
number: '2'
base: '2'
shift: '2'
alt: '@'
shift+alt: '@'
}
after
key 2 {
label: '2'
number: '2'
base: '\u0115'
shift: '2'
alt: '@'
shift+alt: '@'
}
Now "2" will result in a "ě" .. shift+2 will be your regular "2". Hope that helps.
my own polish physical keyboard layout and char map:
http://forum.xda-developers.com/attachment.php?attachmentid=2293495&stc=1&d=1380569369
voicesearch key (the stupid microphone) mapped to ALT_RIGHT
'ć', 'ę', 'ł', 'ń', 'ó', 'ś', 'ź', 'ż' under right alt+c, e, l, n, o, s, x and z key, respectively
'ą' is under right alt+q key, i could not make it work with a
e-mail key mapped to CTRL_LEFT, crtl+c and ctrl+v shortcuts work
i also recommend this:
http://source.android.com/devices/tech/input/key-character-map-files.html
to everyone making custom keyboard layouts. it explains *.kcm files well
i would like to thank kueber, dillalade and mazak23
good to see that i am not the first t699 user in poland
So, who wants to kang this for us? https://github.com/CyanogenMod/andr...mmit/7f6a2c6a56aceca8505cfce97c5a2cf77612a791
Alternatively, if we set this up, would people submit keymaps for various languages?
Nardholio said:
Alternatively, if we set this up, would people submit keymaps for various languages?
Click to expand...
Click to collapse
feel free to use mine and modify it in any way you like

[GUIDE] How to get good Ctrl and Alt keys in SSH while keeping Fn

Hi folks. I use JuiceSSH. In the current CM settings, it interprets the hardware alt key as an actual console alt. This is nice for changing windows in irssi (Alt+1, Alt+2, ...), but it's not useful for getting at the Fn keys for special characters. It would be nice to have Fn, Ctrl, and Alt, all working. Here's how to get this done:
View this: hxxp://data.zx2c4.com/galaxy-relay-keyboard-map.jpg
The file /system/usr/keylayout/sec_keypad.kl contains correlations of keycodes and keychars. It turns out JuiceSSH interprets ALT_LEFT as console alt, ALT_RIGHT as Fn, and CTRL_LEFT as console ctrl. So in that file, we want to remap ALT_LEFT to ALT_RIGHT, and then remap the MAIL and CHAT keys to CTRL_LEFT and ALT_LEFT respectively:
Code:
key 56 ALT_RIGHT WAKE_DROPPED
key 155 CTRL_LEFT WAKE_DROPPED
key 429 ALT_LEFT WAKE_DROPPED
key 217 META_LEFT WAKE_DROPPED
The full keycode file is available at hxxp://data.zx2c4.com/sec_keypad_modified.kl .
Here's a command listing of how I enable this using adb:
Code:
[email protected] ~ $ adb shell
[email protected]:/ $ su
[email protected]:/ # mount -o rw,remount /system
[email protected]:/ # wget -O /system/usr/keylayout/sec_keypad.kl hxxp://data.zx2c4.com/sec_keypad_modified.kl
[email protected]:/ # reboot
In practice, this thus far works very well.
Remember to change "hxxp" in this post; as a new member of XDA, I'm not allowed to post links.
I don't use JuiceSSH (but I'll definitely try it at some point if only for mosh), so I tried that with the built-in terminal app. By the way I don't know what version of CM 10.2 you're using, but here on the 20130909 nightly I found the kymaps in /system/usr/keylayout and not in /system/usr/keymap.
I didn't remap ALT_LEFT, but did remap 155 to CTRL_LEFT and 429 to META_LEFT like you did. I also remapped 217 to ESCAPE which is very handy in vim. Here's the diff:
--- sec_keypad.kl.orig 2013-09-12 17:55:28.434192677 -0600
+++ sec_keypad.kl 2013-09-12 18:12:08.876521089 -0600
@@ -81,3 +81,3 @@
-key 155 ENVELOPE WAKE_DROPPED
-key 429 CONTACTS WAKE_DROPPED
-key 217 SEARCH WAKE_DROPPED
+key 155 CTRL_LEFT WAKE_DROPPED
+key 429 META_LEFT WAKE_DROPPED
+key 217 ESCAPE WAKE_DROPPED
The ESCAPE works but not the CTRL_LEFT and META_LEFT. The remapping does seem to work since the keys don't do any longer what they used to do. So I'm guessing it's the key compositing that doesn't work.
I'll keep looking.
Calchan said:
I found the kymaps in /system/usr/keylayout and not in /system/usr/keymap.
Click to expand...
Click to collapse
Typo! My bad; fixed above.
Calchan said:
ESCAPE which is very handy in vim.
Click to expand...
Click to collapse
That does indeed seem quite handy. I'm tempted to remap the mic button away from META how it is now (which is a bit useful but not super) and toward escape for vim. Good idea.
Having a working ctrl and alt key for android itself, not just the terminal, is proving invaluable. Ctrl+A, ctrl+C, ctrl+V, alt+left, alt+shift+left, etc -- all really nice to have when editing text.
You will most likely have to recompile the kernel to change those to alt and ctrl keys. The keys are laid out in board-apexq.c and they are mapped with standard linux keycode names from input.h.
Nardholio said:
You will most likely have to recompile the kernel to change those to alt and ctrl keys. The keys are laid out in board-apexq.c and they are mapped with standard linux keycode names from input.h.
Click to expand...
Click to collapse
I didn't have any such problem, and just changed the keycode association in the .kl file.
zx2c4 said:
That does indeed seem quite handy. I'm tempted to remap the mic button away from META how it is now (which is a bit useful but not super) and toward escape for vim. Good idea.
Click to expand...
Click to collapse
Key 214 is indeed the microphone key, and having that mapped to ESCAPE like I did is very handy. What is META used for?
Can you please try the CTRL and ALT keys in the defaut CM terminal and tell me if they work for you? I haven't had time yet to try in JuiceSSH yet, but they don't work in the default terminal here.
cm 10.2
To make the ALT keys work as described in cm 10.2, you need to delete /system/usr/idc/sec_keypad.idc .
I've found a more careful change, submitted here:
hxxp://review.cyanogenmod.org/#/c/53130/
I used your fix to make JuiceSSH working on my Relay (yes i bought one only for the keyboard/ssh - can't do that on my expensive N5)
It looks like the arrow keys are mapped 'backward' and some alt-<combination> keys (like the '.com') arn't working, is this correct?
[edit]
I fixed it (or it has been fixed by updating to a newer nightly of CM11). But I did also remove the 'idc' file as suggested in this thread, by placing it back things seemed to work correctly (the arrow keys)
[/edit]
I also had to edit Generic.kl.
how to edit system files?
I cant do it even though i have root and es file explorer has access to root ;/
help
EDIT:
Got it
Is ADB process required? or can i just reboot ?

Categories

Resources