Usb Keyboard Layout


milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,748
Age
40
Location
Rotherham, UK
I have a lovely external usb keyboard but the kays arnt mapped correctly when I use it with the pandora.


Is there anyway the kayboard layout on the pandora can change to a standard uk keyboard layout when I add my usb keyboard then revert back to the pandora layout when I remove the the usb kayboard?
 
on xfce, i would be that ~/.PNDmodmap is what fucking up some of the mapping for your keyboard, since a bunch of keys are remapped for the pandora board.


now only issue is, i have no idea how to force a reset of the current map back to standard. if you can figure that out, then you could make a script and run it to clear the map when you use your keyboard, and restore it when you stop using it (xmodmap ~/.PNDmodmap) would restore the original mapping.
 
OK I solved it :) with a little help from #openpadora IRC channel


the pandora xmodmap file is stored in:



Code:
~/.pndXmodmap



what I did was plug my keyboard into my pc (with ubuntu installed) tested the keyboard was mapped correctly which is was.

I then exported the "in use" modmap using the following command





Code:
xmodmap -pke > ~/.usbXmodmap



copied that file over the same directory as .pndXmodmap on the pandora, then ran the command





Code:
xmodmap ~/.usbXmodmap



works a treat except I have to run the command in terminal to make it work, I tried creating a udev file to automate switching back and forth between xmodmap layouts when i plugin/unplug the keyboard but Im rubbish with udev rules.



anyone wanna help with that?



my current non working rule looks somthing like this:





Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="062a", ATTR{idProduct}=="0602", ACTION=="add", RUN+="xmodmap ~/.usbXmodmap"

SUBSYSTEM=="usb", ATTR{idVendor}=="062a", ATTR{idProduct}=="0602", ACTION=="remove", RUN+="xmodmap ~/.pndXmodmap"


can anyone see any erros?
 
Last edited by a moderator:
Ahh.. got a bit closer to it I see :)


So most of my "help" was a tad useless :D but seems you figured it out a bit better anyway, just have the udev stuff to deal with.


I don't see anything directly wrong with that.. you could try putting in the full path to xmodmap ( which should be /usr/bin/xmodmap ) and see if that works any better?
 
I tried it with the full path already, no joy, I really dont know what im doing wrong and im almost sure I shouldnt have to specify



Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="062a", ATTR{idProduct}=="0602",


twice should I?
 
Last edited by a moderator:
Back
Top