Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
matejdro
Old
#1  
Senior Member - OP
Thanks Meter 42
Posts: 1,004
Join Date: Jul 2009
Default Where to find HW KB scancodes

I'm trying to make proper keymaping for X1 HW keyboard, but i'm stuck at the beginning. How to get keys scancodes?

Is there any WM or Android app that can display scancode on key press?
Current Phone: Samsung Galaxy Note II (Global version)

Phone History:
 
MapleDouglas
Old
#2  
MapleDouglas's Avatar
Senior Member
Thanks Meter 13
Posts: 657
Join Date: Oct 2008
I don't know anything about scancodes, but could this be useful?

http://msdn.microsoft.com/en-us/library/bb431750.aspx

I found this as well:

http://forum.xda-developers.com/showthread.php?t=326046
 
Jonny4911
Old
#3  
Jonny4911's Avatar
Senior Member
Thanks Meter 9
Posts: 583
Join Date: Jan 2009
Location: Hounslow
There is (i believe, according to the Kovsky Linux Wiki) a fully working keymap file here. i've had a quick look and it looks pretty complicated, but complete, just have to find a way to implement it in android i guess

|.HTC Desire HD.| H-Boot: Stock H-Boot Security: Radio S-Off ROM: What I'm posting in OS: Android Radio: 12.65.60.29_26.14.04.28
Sim Lock: Unlocked Network: Vodafone UK
Previous Devices: HTC Desire Z, HD2, Sony Ericsson Xperia X1i, K850i, K800i, K750i, T630i, Motorola E1000, V3 RAZR, Siemens C90, Nokia N95 8GB, 3410, 3330, 3310, Sagem ? (Yes, I'm still a teenager!)
 
n00b3r
Old
#4  
Member
Thanks Meter 0
Posts: 74
Join Date: Feb 2008
We just need to replace /system/usr/keylayout/qwerty.kl with that I believe.
 
n00b3r
Old
(Last edited by n00b3r; 14th April 2010 at 02:26 AM.)
#5  
Member
Thanks Meter 0
Posts: 74
Join Date: Feb 2008
Apparently the filesystem is only in RO mode. Let me try to re-mount with rw.

Edit: Nope, doesn't allow me to go to rw mode... don't know how we can replace it.
 
CowMix
Old
#6  
Senior Member
Thanks Meter 2
Posts: 271
Join Date: Apr 2009
you need to uncompress the squashfs or the zImage file systems, wherever the file is, overwrite the keyboard and recompress them

I tried messing around with the keyboard mapping as well but messing with the android files that haret is using is over my head
 
n00b3r
Old
(Last edited by n00b3r; 15th April 2010 at 06:36 AM.)
#7  
Member
Thanks Meter 0
Posts: 74
Join Date: Feb 2008
Edit: Read post below for information on how to mount and edit the 2 files (rootfs.img and system.sqsh)
 
n00b3r
Old
(Last edited by n00b3r; 15th April 2010 at 06:38 AM.)
#8  
Member
Thanks Meter 0
Posts: 74
Join Date: Feb 2008
I basically extracted and changed the file and recreated the sqsh, but it was 4.0 which the android kernel doesn't support. I'm going to install a lower kernel (2.6.29)- and install mksquashfs that does support making 3.1 sqfs'.

Edit: Got squash-tools 3.4.1 installed on CentOS 5.3. Changed qwerty.kl into the Xperia keymap. Remade squash file and booted up Haret. Kernel boots up squashfs fine. Time to try if the keys actually work like it should.

Edit2: Keys are even more messed up with this key layout than original qwerty. I looked at the both files and they look hugely different... the format is complete different as well. Also, its no point opening up and recompiling the sqsh, qwerty.kl is symlinked to /etc/keylayout/qwerty.kl, which is in /init.etc/keymaps in the rootfs.img.

How to uncompress/remake squashfs. You need squash-tools 3.4.1 to make a squashfs 3.1 filesystem needed for Fatsal's android kernel (assuming root access).
Quote:
# unsquashfs system.sqsh; cd squashsh_root/
... do your changes to sqsh here ...
# makesquashfs ./ system.sqsh -le
Make sure you do not forget the -le flag, the -le flag was also used in the original file. Check the flags used in the compression of the original sqsh file for reference by going:
# unsqashfs -s system.sqsh
Here's how to mount rootfs.img and location of the keymap that's being called by a symlink in system.sqsh (qwerty.kl) (assuming root access):
Quote:
# mkdir /mnt/rootfs
# mount -o loop rootfs.img /mnt/rootfs
# cd /mnt/rootfs/init.etc/keymaps
rootfs.img is writeable after mounting, so you can make changes and the unmount and copy the new img onto your sd card.


Here's the qwerty.kl included with fatsal's android build, if someone would be kind enough to look at this and modify this one according to it?
Quote:
key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 114 VOLUME_DOWN
key 116 POWER WAKE
key 212 CAMERA

key 16 Q
key 17 W
key 18 E
key 19 R
key 20 T
key 21 Y
key 22 U
key 23 I
key 24 O
key 25 P
key 26 LEFT_BRACKET
key 27 RIGHT_BRACKET
key 43 BACKSLASH

key 30 A
key 31 S
key 32 D
key 33 F
key 34 G
key 35 H
key 36 J
key 37 K
key 38 L
key 39 SEMICOLON
key 40 APOSTROPHE
key 14 DEL

key 44 Z
key 45 X
key 46 C
key 47 V
key 48 B
key 49 N
key 50 M
key 51 COMMA
key 52 PERIOD
key 53 SLASH
key 28 ENTER

key 56 ALT_LEFT
key 100 ALT_RIGHT
key 42 SHIFT_LEFT
key 54 SHIFT_RIGHT
key 15 TAB
key 57 SPACE
key 150 EXPLORER
key 155 ENVELOPE

key 12 MINUS
key 13 EQUALS
key 215 AT
Hope this helps...
 
X1iser
Old
(Last edited by X1iser; 22nd April 2010 at 08:48 PM.)
#9  
Senior Member
Thanks Meter 52
Posts: 283
Join Date: Apr 2009
I try to relocate qwerty.kl

green code: Edit key code
orange code: Add key code (from other qwerty.kl file)
red: Add supposed key code

Edit: I try to edit system.sqsh but android stuck as boot animation.

Quote:
key 41 GRAVE
key 79 1
key 80 2
key 81 3
key 75 4
key 76 5
key 77 6
key 71 7
key 72 8
key 73 9
key 82 0

key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER WAKE
key 212 CAMERA

key 16 Q
key 17 W
key 18 E
key 19 R
key 20 T
key 21 Y
key 22 U
key 23 I
key 24 O
key 25 P
key 26 LEFT_BRACKET
key 27 RIGHT_BRACKET
key 43 BACKSLASH

key 30 A
key 31 S
key 32 D
key 33 F
key 34 G
key 35 H
key 36 J
key 37 K
key 38 L
key 39 SEMICOLON
key 40 APOSTROPHE
key 14 DEL

key 44 Z
key 45 X
key 46 C
key 47 V
key 48 B
key 49 N
key 50 M
key 51 COMMA
key 52 PERIOD
key 53 SLASH
key 28 ENTER

key 56 ALT_LEFT
key 100 ALT_RIGHT
key 42 SHIFT_LEFT
key 54 SHIFT_RIGHT
key 15 TAB
key 57 SPACE
key 150 EXPLORER
key 155 ENVELOPE

key 12 MINUS
key 13 EQUALS
key 3 AT

key 1 ESCAPE
key 55 MULTIPLY
key 58 CAPS_LOCK
key 118 PLUS

Hope this help
 
n00b3r
Old
(Last edited by n00b3r; 23rd April 2010 at 12:49 AM.)
#10  
Member
Thanks Meter 0
Posts: 74
Join Date: Feb 2008
I won't have time to try it out X1iser, but I'll put this file into the rootfs.img, and upload it for you to try it yourself.

Edit: Here it is,
http://www.mediafire.com/?owzdrztko32

Replace that rootfs.img with your current one.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Guide Your Sheep to Safety with Finger Shepherd

Just a coupe of days ago, we brought you news about a game calledAgent Sheep. In that … more

Nandroid Manager Receives Major Update

Do you find yourself obsessively jumping from ROM to ROM? And do you hate having to restore a full … more

Careers in Android: Recruiter Reveals How Resumes are Chosen – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more

HttpClient Tutorial to Upload and Download with Your App

Developers wanting to interact with the Internet need to choose a package to do the … more