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

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

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.

Add leading 0 (zero) on lockscreen clock

Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
eg: Lockscreen shows 8:00. I want 08:00.
Thanks in advance.
PS - I can get the zero with lockscreen widgets in CHT2. BUT I want it without any widget add ons.
Try Start-Settings-System-Regional Settings-Time [Page]-Time style HH:mm:ss
hgalanos said:
Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
eg: Lockscreen shows 8:00. I want 08:00.
Thanks in advance.
PS - I can get the zero with lockscreen widgets in CHT2. BUT I want it without any widget add ons.
Click to expand...
Click to collapse
Thanks for your reply. I have changed the regional settings to:
hh:mm:ss and also
HH:mm:ss
Nothing happens. The flip clock stays without a zero.
If you are looking for lockscreen with leading zero try manals Windows LockScreen V4 http://forum.xda-developers.com/showthread.php?t=854047
with settings below it have leading zero for sure. (This is standard windows lockscreen modification, not CHT)
hgalanos said:
Thanks for your reply. I have changed the regional settings to:
hh:mm:ss and also
HH:mm:ss
Nothing happens. The flip clock stays without a zero.
Click to expand...
Click to collapse
The Touch x 24 hours clock fixes the alarm and lockscreen so they now appear as 08:00.
However nothing I have tried works for the home screen flip clock.
Anyone?
Try reg:
[HKEY_LOCAL_MACHINE\nls\overrides]
"STFmt"="HH:mm:ss tt" // (Ex: 08:00 AM or 20:00 PM)
"SSDte"="dd-MM-yyyy" // (Ex: 08-01-2011)
Yep, already tried/checked that. It is as you wrote it.
ALL clocks are showing leading zero, just not Manila home flip clock. Very strange.
Surely there is a way to change it.
hgalanos said:
Yep, already tried/checked that. It is as you wrote it.
ALL clocks are showing leading zero, just not Manila home flip clock. Very strange.
Surely there is a way to change it.
Click to expand...
Click to collapse
It will be controlled by the LUA script for the CHT main clock (assuming it is the main one with various flip/analog/weather options. I'll have a look over the weekend if you like?
Would I be safe in assuming you've already gone to the manila settings tab, date & time and then ticked 24-hour format?
Swarvey said:
Would I be safe in assuming you've already gone to the manila settings tab, date & time and then ticked 24-hour format?
Click to expand...
Click to collapse
Yes you would be safe in assuming this.
As per the ealier threads, time format, local settings have all been checked and changed. Even the registry. Nothing changes the flip clock have a leading zero.
Depending on what version of cht or sense you have it will be in the lua. There should be a statement near the top that says "shouldhideleadingzeros = true" you just need to change it to false and recompile.
EDIT:
Looked into it a little more for you and the file is 5fa4d4b7_manila from your stock sense.
Code:
-- Decompiled using luadec 3.2.2beta -- Tue Jan 11 10:19:35 2011
-- File name: 5fa4d4b7_manila
trace("Loaded digital clock\n")
TabHalf = {Tab = nil, HighDigit = nil, LowDigit = nil}
UV = {UP = 0.26171875, DOWN = 0.5234375}
TabHalf.new = function(l_1_0, l_1_1)
if not l_1_1 then
l_1_1 = {}
end
setmetatable(l_1_1, l_1_0)
l_1_0.__index = l_1_0
return l_1_1
end
TabFlip = {Time = 0, TimeDifference = 0, ShowingTime = 0, WrapAroundNumber = 0, StartValue = 0, [B][COLOR="Red"][B]ShouldHideLeadingZeros = true[/B][/COLOR][/B], TopTab = nil, TopTabFlip = nil, BottomTab = nil, BottomTabFlip = nil, LastDuration = -1, UseAltTiming = false, rotatecount = 1, getDuration = function(l_2_0)
if l_2_0.UseAltTiming then
Wow, I have stock version of 1.72 WWE ROM.
It sound like you are on a winner.
I will check this out tonight when I get home and see what I can do.
Thank you for the information, I will be sure to let you know what happens.
mrhayami said:
Depending on what version of cht or sense you have it will be in the lua. There should be a statement near the top that says "shouldhideleadingzeros = true" you just need to change it to false and recompile.
EDIT:
Looked into it a little more for you and the file is 5fa4d4b7_manila from your stock sense.
Code:
-- Decompiled using luadec 3.2.2beta -- Tue Jan 11 10:19:35 2011
-- File name: 5fa4d4b7_manila
trace("Loaded digital clock\n")
TabHalf = {Tab = nil, HighDigit = nil, LowDigit = nil}
UV = {UP = 0.26171875, DOWN = 0.5234375}
TabHalf.new = function(l_1_0, l_1_1)
if not l_1_1 then
l_1_1 = {}
end
setmetatable(l_1_1, l_1_0)
l_1_0.__index = l_1_0
return l_1_1
end
TabFlip = {Time = 0, TimeDifference = 0, ShowingTime = 0, WrapAroundNumber = 0, StartValue = 0, [B][COLOR="Red"][B]ShouldHideLeadingZeros = true[/B][/COLOR][/B], TopTab = nil, TopTabFlip = nil, BottomTab = nil, BottomTabFlip = nil, LastDuration = -1, UseAltTiming = false, rotatecount = 1, getDuration = function(l_2_0)
if l_2_0.UseAltTiming then
Click to expand...
Click to collapse
ok so I couldn't wait and though I would give it a go now. I have found the same Manila file you have listed, I also downloaded lua utility. How doesn this work, I ran it on my pc and nothing happens.
How can I edit the file?
hgalanos said:
ok so I couldn't wait and though I would give it a go now. I have found the same Manila file you have listed, I also downloaded lua utility. How doesn this work, I ran it on my pc and nothing happens.
How can I edit the file?
Click to expand...
Click to collapse
Well I suggest downloading the manila kitchen by 12 and kilaireg found here:
Thread
It will tell you how to run everything you need but the down and dirty is this.
Copy the manila file into this directory "kitchen>_source>file>xxxx_manila
then use the command prompt link and drag the file manilatool.cmd into the cmd window.
your main commands are going to be as followed in order:
-oem:2.5
-mnf:2.5
-dec
(now that it is decompiled you will be edit the lua in notepad save and then move to the next step.)
Notice: not all files will decompile correctly and you may have to tweak it to get it to decompile correctly.
-cmp (only if it does not fully decompile aka. you have the file in your incomplete folder.)
-rec (will recompile the file which you can then put on your device and enjoy)
I know it isn't much but as I said they have detailed info in the pack.
In case anyone is still trying to figure this out.
I installed the latest 314 WWE ROM and it supports a leading zero on the original manila clock.
Awesome.
hgalanos said:
Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
...
Click to expand...
Click to collapse
If you set PocketShield clock display to 24h it will display the leading 0
NO fix as yet.
Guys,
I have to apologise, I don't know what planet I was on, but the new 314 ROM, does NOT fix this issue. There is still no leading zero for manila flip clock.
Anyway have a fix that works?
I have no idea how to edit manila files, and have not been successful is doing so.
I will have to rely on someone generous enough to do it for me.
Thank you in advance to anyone willing to help.

[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 ?

How to handle multi-keycode keys on Android with a bluetooth keyboard?

I have a Microsoft Mobile Wedge keyboard. I've connected it to my Nexus 9 and after setting the language in the settings it works almost perfectly. Almost!
There are 4 keys on it that don't work, because they're multi-keycode keys. They're the "magnifier glass"-key, the "3 dots on a ring"-key, the "black rectangle intersecting with rectangle border"-key and the "gears/settings"-key.
So far I've found out with
Code:
getevent -lt /dev/input/event4
that the Linux keycodes they send are
Code:
KEY_LEFTSHIFT
KEY_LEFTMETA
KEY_F21
Code:
KEY_LEFTALT
KEY_LEFTMETA
KEY_F21
Code:
KEY_LEFTCTRL
KEY_LEFTMETA
KEY_F21
Code:
KEY_LEFTMETA
KEY_F21
I've created the 2 files
Code:
/system/usr/keylayout/Vendor_045e_Product_0790.kl
/system/usr/keychars/Vendor_045e_Product_0790.kcm
and made sure with
Code:
dumpsys input
that they're used.
I tried to enable the F21 in the layout first, but that didn't work because there's no Android keycode for F21. So I bound it to INSERT instead, because it's an unused key.
Then I went into the character map and tried making an INSERT key (which is actually F21) and apply the right modifiers to it.
Code:
key INSERT {
base: 'a'
lmeta: 'A'
}
The above being for the key that only had 2 keycodes. Unfortunatley this didn't work. Nothing happened. So now I'm here to pick your brain.
Does anyone know how to do multi-keycode keys?
Thank you very much in advance.

Categories

Resources