Author Topic: Adding a custom keyboard layout in Kubuntu  (Read 4759 times)

0 Members and 1 Guest are viewing this topic.

Offline dotancohen

  • Thread Starter
  • Posts: 140
    • Dotan Cohen
Adding a custom keyboard layout in Kubuntu
« 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!

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Adding a custom keyboard layout in Kubuntu
« Reply #1 on: Mon, 28 February 2011, 22:46:24 »
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...
« Last Edit: Mon, 28 February 2011, 22:55:59 by PrinsValium »

Offline dotancohen

  • Thread Starter
  • Posts: 140
    • Dotan Cohen
Adding a custom keyboard layout in Kubuntu
« Reply #2 on: Tue, 01 March 2011, 02:34:58 »
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.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Adding a custom keyboard layout in Kubuntu
« Reply #3 on: Tue, 01 March 2011, 05:01:23 »
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.

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Adding a custom keyboard layout in Kubuntu
« Reply #4 on: Tue, 01 March 2011, 22:56:36 »
Have you tried the setxkbmap command? I think it only requires the file in symbols/ and has nothing to do with evdev.xml.

Offline dotancohen

  • Thread Starter
  • Posts: 140
    • Dotan Cohen
Adding a custom keyboard layout in Kubuntu
« Reply #5 on: Fri, 07 October 2011, 07:21:25 »
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.

Offline thebilgerat

  • Posts: 68
Adding a custom keyboard layout in Kubuntu
« Reply #6 on: Fri, 07 October 2011, 11:28:11 »
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/

Offline sordna

  • Posts: 2248
Adding a custom keyboard layout in Kubuntu
« Reply #7 on: Fri, 07 October 2011, 12:12:49 »
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
Kinesis Contoured Advantage & Advantage2 LF with Cherry MX Red switches / Extra keys mod / O-ring dampening mod / Dvorak layout. ErgoDox with buzzer and LED mod.
Also: Kinesis Advantage Classic, Kinesis Advantage2, Data911 TG3, Fingerworks Touchstream LP, IBM SSK (Buckling spring), Goldtouch GTU-0077 keyboard

Offline dotancohen

  • Thread Starter
  • Posts: 140
    • Dotan Cohen
Adding a custom keyboard layout in Kubuntu
« Reply #8 on: Sun, 09 October 2011, 08:17:19 »
Quote from: thebilgerat;426982
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.

Quote
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!

Quote
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!

Offline dotancohen

  • Thread Starter
  • Posts: 140
    • Dotan Cohen
Adding a custom keyboard layout in Kubuntu
« Reply #9 on: Sun, 09 October 2011, 08:19:20 »
Quote from: sordna;427005
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!
« Last Edit: Sun, 09 October 2011, 13:58:19 by dotancohen »