geekhack
geekhack Community => Off Topic => Topic started by: dotancohen on Mon, 28 February 2011, 19:11:26
-
Hi all, I have written a custom keyboard layout that I'm trying to install in Kubuntu 10.10. This is the layout:
http://dotancohen.com/eng/keyboard_layout.html
I have added the layout as /usr/share/X11/xkb/symbols/dotan and made these changes:
In /usr/share/X11/xkb/rules/base.lst I added this:
! layout
dotan Dotan
Of course, the !layout line was already there, I did not touch it.
In /usr/share/X11/xkb/rules/base.xml I added this:
dotan
Dotan
Dotans Layout
Of course, the line was already there, I did not touch it.
However, after a reboot I do not see the new layout in KDE's
configuration for these things. What did I miss or do wrong? Thanks!
-
Try
$ sudo rm /usr/lib/xkb/*.xkm
That folder seems to contain all compiled layouts. I had to delete them all the time when I was fiddling around with layouts. That's the only thing I can think of at the moment. They seem to be generated when needed but of course it might be wise to back them up first...
-
Thanks, Prins. Luckily I mv'ed instead of rm'ed, as without those files I could not get X to start, even after reverting the changes to the other files. The log file simply stated that it could not compile the keyboard maps, with no indication of the offending file or line.
By the way, in 10.10 they were in /var instead of /usr.
I must have done something wrong, I'm off to google what it might have been. Thanks.
-
My bad, they have probably been in /var/ previously too. I tried moving (just in case..) them myself right now and when using $setxkbmap to change layout new ones were generated. Perhaps there is a fault in your evdev.xml rendering ubuntu unable to generate them. Also, if I remember correctly evdev.xml is the only place where you actually need to change anything.
At least when modifying existing layouts I had to do the rm procedure for ubuntu to regenerate the .xkm-files. Adding a new probably shouldn't have the same problem.
-
Have you tried the setxkbmap command? I think it only requires the file in symbols/ and has nothing to do with evdev.xml.
-
Sorry for the late reply. Only now did I notice that there were posts that I missed.
The setxkbmap command cannot be used to move the modifier keys around. At least, that has been my experience. When I try I get unusual behaviour, such as both keys performing each others' functions as well as their own.
-
As long as you aren't radically revamping the keyboard layout, many of your tweaks can be made in the Keyboard control panel.
Did you check these out?
http://linux.derkeiler.com/Mailing-Lists/KDE/2009-02/msg00320.html
http://hektor.umcs.lublin.pl/~mikosmul/computing/articles/custom-keyboard-layouts-xkb.html
I'd watch this link too, it seems the guy is having a similar issue :D
http://www.linuxquestions.org/questions/linux-general-1/adding-a-custom-keyboard-layout-in-kubuntu-865610/
-
Not sure how to handle modifier behavior in layout maps, but when I remap keys with xmodmap, I run into problems with modifiers unless I first remove the modifier and add it back after I remap it.
For example, to make the Y key work as SHIFT, I need to do the following to make it work right:
xmodmap -e 'remove shift = Shift_R'
xmodmap -e 'keycode 29 = Shift_R'
xmodmap -e 'add shift = Shift_R'
HTH
-
As long as you aren't radically revamping the keyboard layout, many of your tweaks can be made in the Keyboard control panel.
Actually, it is quite radical! Almost every single key is remapped.
Did you check these out?
http://linux.derkeiler.com/Mailing-Lists/KDE/2009-02/msg00320.html
http://hektor.umcs.lublin.pl/~mikosmul/computing/articles/custom-keyboard-layouts-xkb.html
The first one looks the issue, thanks! The second one is bookmarked and thoroughly read!
I'd watch this link too, it seems the guy is having a similar issue :D
http://www.linuxquestions.org/questions/linux-general-1/adding-a-custom-keyboard-layout-in-kubuntu-865610/
Right, I think that guy hangs out on Geekhack. His nick looks familiar!
-
Not sure how to handle modifier behavior in layout maps, but when I remap keys with xmodmap, I run into problems with modifiers unless I first remove the modifier and add it back after I remap it.
For example, to make the Y key work as SHIFT, I need to do the following to make it work right:
xmodmap -e 'remove shift = Shift_R'
xmodmap -e 'keycode 29 = Shift_R'
xmodmap -e 'add shift = Shift_R'
HTH
Thanks, Sordna. I think that might be the key that I need!