Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Remote keyboard remapping not works
#1
I would like to remap 2 keys on my USB remote keyboard connected as following according to "cat /proc/bus/input/devices":

I: Bus=0003 Vendor=400c Product=107a Version=0101
N: Name="SAGE SAGE AirMouse"
P: Phys=usb-ff540000.usb-1.2/input2
S: Sysfs=/devices/ff540000.usb/usb3/3-1/3-1.2/3-1.2:1.2/input/input4
U: Uniq=
H: Handlers=event4 cpufreq ddr_freq keychord
B: PROP=0
B: EV=1f
B: KEY=3007f 0 0 0 0 4c3ffff 17aff32d bf544446 0 0 1 120f93 8b17c000 677bfa d951dfed 9ed680 4400 0 10000002
B: REL=40
B: ABS=1 0
B: MSC=10

I copy Vendor_400c_Product_107a.kl with remapped keys into /system/usr/keylayout, I found nothing take effect after system reboot.  The only way I can get the remapping to works is to directly modify Generic.kl in the same directory.  Any idea why?
Reply
#2
Hi samsonluk,

I plug in my usb keyboard.  I can see below log and load  "/system/usr/keylayout/Vendor_0461_Product_0010.kl".
Vendor_0461_Product_0010.kl is my keymap and copied from Generic.kl .

05-17 10:53:53.073   426   594 I EventHub: New device: id=16, fd=192, path='/dev/input/event3', name='NOVATEK USB Keyboard', classes=0x80000401, configuration='', keyLayout='/system/usr/keylayout/Vendor_0461_Product_0010.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false, wakeMechanism=EPOLLWAKEUP, usingClockIoctl=true

Can you find this log in your logcat ? It will show when you re-plug in your USB keyboard.
It can help you to see which keylayout you loaded.

==============================

This is my test below. I think it is related to your modification.

Modify file   "key 24    O"  to  "#key 24    O" and re-plug in my keyboard.  
Key "O" is disabled and load "Vendor_0461_Product_0010.kl".

Modify file   "key 24    O"  to  "key 24    OO" and re-plug in my keyboard.  
Key "O" is enabled and load "Generic.kl".

Modify file   "key 24    O"  to  "key 24    P"  and re-plug in my keyboard.  
Key "O" is enabled and change to output "P" and load "Vendor_0461_Product_0010.kl".
Big Grin  I'm Lyle. 
Reply
#3
@Lyle, thanks, just figure out it was due to some errors inside my Vendor_400c_Product_107a.kl and it works now!

Another issue is that I found keys erratically repeat for many characters like thissssssssssssss and even the arrow keys occasionally get stuck scrolling down in menus. Also, some key presses are randomly not detected. At first I would guess it's the keyboard itself but after googled a bit, and saw that this was a problem for many android users.  I tested the keyboard under Windows and Linux and found no such problem so shouldn't be hardware related.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)