FORUMS
Remove All Ads from XDA

Custom keyboard layout

191 posts
Thanks Meter: 42
 
By LuH, Senior Member on 11th October 2012, 09:10 PM
Post Reply Email Thread
Hey, I found OK and caps lock keys on the D4 keyboard useless - I just don't see any difference between using OK, mapped as D-pad center, and Enter, and caps lock can be substituted by double press of shift. So I decided to play with the layout a bit, mainly because I was irritated by a need to touch the screen to work with clipboard or to go back.

The result is attached - a custom layout which remaps OK button from DPAD_CENTER to ESCAPE and caps lock from CAPS to CTRL_LEFT.

Esc works as the Back button and Ctrl is tested working in combinations of Ctrl+A (Select all), Ctrl+X (Cut), Ctrl+C (Copy) and Ctrl+V (Paste). Unfortunately Ctrl+Z/Y (Undo/Redo) don't seem to work... Any suggestions for other combinations to try?

I have tested it all on rooted Eclipse ICS 1.2 ROM, but it should generally work on all rooted Android 4.0.4 ROMs.

How to get it working?
1. You probably need to have your phone rooted first.
2. Optional - you might want to backup your original /system/usr/keylayout/omap4-keypad.kl if you're on different ROM (it should be all the same, but I haven't tested it)
3. Unpack the attached custom_layout.zip to the root of your phone - it will put omap4-keypad.kl into /system/usr/keylayout
4. Reboot your phone.


In case you'd like to revert the changes, I put the original keylayout from my system in original_layout.zip, or you can use your own backed up file

Hope you enjoy my mod. Also, which key would you suggest to replace by Menu? I'm thinking about SYM, but I still think the day I'll actually need it might come, unlike with caps lock and OK

For those interested in changing values for themselves I've attached scancodes of all the buttons given out by safestarap's key test - see keycodes.txt. If you're gonna change any .kl files, be sure to open it with some program supporting UNIX formatting such as PSPad - I really don't wanna see what would happen after editing it with Notepad You should probably also see Android documentation article about it first.
Attached Files
File Type: zip custom_layout.zip - [Click for QR Code] (1.1 KB, 561 views)
File Type: zip original_layout.zip - [Click for QR Code] (1.1 KB, 313 views)
File Type: txt keycodes.txt - [Click for QR Code] (975 Bytes, 874 views)
The Following 3 Users Say Thank You to LuH For This Useful Post: [ View ] Gift LuH Ad-Free
 
 
12th December 2012, 12:14 AM |#2  
Senior Member
Thanks Meter: 15
 
More
This sounds rather good...i wasn't going to, but this may give me a reason to root my phone. Thanks f for your work. It does seem illogical having those buttons. Btw what happens to LED when you press caps lock now.

Still running stock ics on Vodafone UK.

Sent from my DROID4 using xda app-developers app
16th December 2012, 06:37 PM |#3  
wheeliest's Avatar
Senior Member
Flag Mesa
Thanks Meter: 9
 
Donate to Me
More
This doesnt seem to work on stock rooted.

it seems the physical keyboard runs off generic.kl and the omap4.kl, but i simply used root explorer to edit the KL's and got things how i wanted them. i missed my HTC G2 alt + del/backspace = delete whole line, so i made tab the ALT_LEFT and problems solved, also mapped OK as CTRL_LEFT for copy paste ext.. just my pref.

also changed all the qwerty keys to WAKE_DROPPED to wake the screen instead of having to hit the top power button, as i leave my phone on my desk open constantly so its annoying to always have to hit the power button to wake.
17th December 2012, 10:11 AM |#4  
Senior Member
Thanks Meter: 15
 
More
So do you have to change the 2 files or just the one?

Sent from my DROID4 using xda app-developers app
17th December 2012, 01:35 PM |#5  
OP Senior Member
Flag CZ
Thanks Meter: 42
 
More
Quote:
Originally Posted by bustr85

Btw what happens to LED when you press caps lock now.

I have Caps Lock mapped as Ctrl and it's not connected to the LED at all - seems the LED is working as normal Caps Lock signalization. However, after double-press of Shift the caps Lock is activated and the LED signalizes it fine.

Quote:
Originally Posted by wheeliest

This doesnt seem to work on stock rooted.

it seems the physical keyboard runs off generic.kl and the omap4.kl, but i simply used root explorer to edit the KL's and got things how i wanted them. i missed my HTC G2 alt + del/backspace = delete whole line, so i made tab the ALT_LEFT and problems solved, also mapped OK as CTRL_LEFT for copy paste ext.. just my pref.

also changed all the qwerty keys to WAKE_DROPPED to wake the screen instead of having to hit the top power button, as i leave my phone on my desk open constantly so its annoying to always have to hit the power button to wake.

Didn't know the Alt+BkSp combination, thanks What other combinations do you use?
BTW Alt+Tab works for switching apps (I have now SYM mapped as ALT_LEFT and TAB is left untouched - I like to use it when filling forms).
In my mod it already is WAKE_DROPPED, but not by me, it's probably one of the Eclipse mods to stock

Quote:
Originally Posted by bustr85

So do you have to change the 2 files or just the one?

Sent from my DROID4 using xda app-developers app

What do you mean? Do you refer to wheeliest's post?
17th December 2012, 06:20 PM |#6  
Inactive Recognized Developer
Flag Los Angeles
Thanks Meter: 264
 
Donate to Me
More
Ah, good idea mapping SYM to ALT_LEFT. Then we can go in and define Alt key combos for the rest of the alpha keys, to get all the other symbols that we need (e.g., brackets, curly brackets, vertical bar, backquote...)

Sent from my DROID4 using Tapatalk
18th December 2012, 02:31 AM |#7  
wheeliest's Avatar
Senior Member
Flag Mesa
Thanks Meter: 9
 
Donate to Me
More
I edited both .kl's to answer the above question,

I also changed the "/" to work as a "?" with out shifting first. (which i changed in the omap4 keychars)

system/usr/keychars/omap4-keypad.kcm

its about the middle of the code, you get into the symbols after the numbers.

key SLASH {
label. number: '?'
base: '?'
shift: '/'
ctrl. alt. meta: none

and thats the only useful key combos i know.
3rd January 2013, 10:24 AM |#8  
Junior Member
Thanks Meter: 0
 
More
I've tried to edit the keyboard for my AOSP Unofficial CM10/JB ROM. No luck at all.

None of the changes take effect and the shift key stops functioning as it should. You have to hold the shift key down and press the additional key for it to work, the same as you do on a computer keyboard.

I've tried to edit both the generic and omap4 files. It always ends up with the same result. Not looking for a fix just notifying you guys.
30th September 2014, 08:16 AM |#9  
Junior Member
Frýdek-Místek
Thanks Meter: 0
 
More
Long press symbols
Hi, does anybody know where to change symbols and/or their order in long press popup window?

screenshot - imgur.com/joN15zH

CM10 or CM11
1st October 2014, 07:46 PM |#10  
Junior Member
Thanks Meter: 2
 
More
Cool
Quote:
Originally Posted by wild_a

Hi, does anybody know where to change symbols and/or their order in long press popup window?

screenshot - imgur.com/joN15zH

CM10 or CM11

Unfortunately I don't know, but I never use it.

My short story:
My old phone was a Motorola Milestone 1 (Droid 1) with physical QWERTY.
I used it with Smart Keyboard Pro (SKP). It has an option called “Physical Keyboard”, by this way I reach the special characters of SKP’s actual language (long press on short character then some short press for selecting).
I changed for Droid4, upgraded for SlimKAT 4.4.2 installed SKP, but it is not worked with new 5-row keyboard. I can’t reach the keyboard’s yellow and my language-specific characters. Shift is not working with yellow keys.
Solution:
Change SYM and CAPS LOCK buttons in /system/usr/keylayout/omap4-keypad.kl:
I changed SYM button for “ALT”:
KEY 162 ALT_LEFT
and the CAPS LOCK button to “CTRL”:
KEY 222 CTRL_LEFT

Than modify /system/usr/keychars/omap4-keypad.kcm as follows:
Defined yellow characters for ALT method, and some other characters for all available buttons. The original SYM function still available by ALT+Space.
I attached a picture about the ALT-characters.

Unfortunately the new CTRL-button not works with SKP “Phisical Keyboard” option so I must switch off this option. By this way I lost the language specific fonts, so I programmed the upper rows for this fonts. The selection is working by SHIFT and D-pad, than CAPS-LOCK + C is Copy and CAPS-LOCK + V is Paste.
I attached a picture about CTRL-characters too.

I used character codes at: fileformat.info
We must be use the C/C++/Java source codes.

Thats all.

Zavo
Attached Thumbnails
Click image for larger version

Name:	QWERTY-ALT-640.gif
Views:	274
Size:	68.8 KB
ID:	2956848   Click image for larger version

Name:	QWERTY-CTRL-640.gif
Views:	280
Size:	68.3 KB
ID:	2956849  
Attached Files
File Type: rar Droid4-Keyboard.rar - [Click for QR Code] (1.73 MB, 70 views)
The Following 2 Users Say Thank You to ZavoDroid For This Useful Post: [ View ] Gift ZavoDroid Ad-Free
7th October 2014, 07:46 PM |#11  
Junior Member
Thanks Meter: 0
 
More
hi.
i wanna change my hardware keyboard of droid4. its qwerty ... and i want to have qwertz.
so i edited the /system/usr/keychars/omap4-keypad.kcm and changeg key "Z" { label base shift } with "Y" . reboot and it works me happy
by thinking myself that i missed Ä Ö Ü at the hardware keyboard and dont want to wait long with long push on a to wait for the popup and choose there ä, i tryed to edit the /system/usr/keylayout/omap4-keypad.kl:
CAPS LOCK button to “ALT”:
KEY 222 ALT_LEFT
and back into the /system/usr/keychars/omap4-keypad.kcm there under A { label: "A" / base : "a" / shift: "A" / cltr,alt,meta: "ä" }
reboot and now it works nothing -.-
also the y z is back to qwerty and not qwertz ?!?!?!??! in the files is all right.
why my changes are undone ????
can some help ? ideas ?
thx and sry 4 bad english
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