You are not logged in.

#1 2009-05-07 03:37:31

friedrich
Member
Registered: 2009-05-07
Posts: 26

[SOLVED] Not all Dvorak Keybourd Layouts work!

Hi everyone,

I hope this is the right place to ask that question.  I am using a Dvorak keyboard layout for about a year now.  However, as I am native German and I do use Emacs a lot, I adjusted the Classic Dvorak Keyboard with some additional features such as adding Umlauts to the layout, switching Control/Caps_Lock, Alt/Tab and making it easier to stroke certain sequences, like $/{, which often occur when typing maths.

The default Dvorak layout that comes with Arch Linux is the so-called Simplified Dvorak Layout.  I am more than happy to write my own layout-file, however, it doesn't seem to work the way I tried.  Here is what I did so far:

I found all the keyboard layouts, including the Dvorak Simplified one, in the following directory:

/usr/share/kbd/keymaps/i386/dvorak/dvorak.map.gz

As root:

cp /usr/share/kbd/keymaps/i386/dvorak/dvorak.map.gz .
gunzip dvorak.map.gz
cp dvorak.map dvorak-prof.map
vim dvorak-prof.map  # Here I changed stuff, e.g.flipping Control/Caps_Lock
gzip dvorak-prof.map
cp dvorak-prof.map.gz /usr/share/kbd/keymaps/i386/dvorak/

I did everything as root as to make sure that the resulting files dvorak.map and dvorak.map.gz have the same reading/writing-permissions as the original dvorak.map and dvorak.map.gz.

For testing I typed during a X-session:

bash-3.2# setxkbmap dvorak-prof
Error loading new keyboard description

New interestingly, I get the same error when loading any one of the other Dvorak layouts, apart from dvorak:

bash-3.2# setxkbmap dvorak-l
Error loading new keyboard description
bash-3.2# setxkbmap dvorak-r
Error loading new keyboard description
bash-3.2# setxkbmap ANSI-dvorak
Error loading new keyboard description
bash-3.2# setxkbmap dvorak
bash-3.2#

The last command being successful.  So, the failure of loading my modified layout file is not necessarily due to a failure in parsing the modified dvorak-prof.map, though I don't know how to check this.

So my question is: What's wrong with dvorak-l, dvorak-r, ANSI-dvorak and dvorak-prof?

Thanks for your help!

Cheers,
Thomas

Last edited by friedrich (2009-05-20 15:04:27)

Offline

#2 2009-05-08 15:22:30

rzodkiewka
Member
Registered: 2009-04-19
Posts: 41

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

$ setxkbmap us dvorak-l
$ setxkbmap us dvorak-r

Worked for me without any previous stuff. ANSI-dvorak and dvorak-prof didn't but I didn't install them. Does adding 'us' help?

Last edited by rzodkiewka (2009-05-08 15:22:48)

Offline

#3 2009-05-14 01:34:19

friedrich
Member
Registered: 2009-05-07
Posts: 26

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

Thanks for your reply.

Your suggestion:

$ setxkbmap us dvorak-l
$ setxkbmap us dvorak-r

does work for me too.  However,

$ setxkbmap us ANSI-dvorak
Error loading new keyboard description
$ setxkbmap us no
Error loading new keyboard description
$ setxkbmap us dvorak-prof
Error loading new keyboard description

doesn't for some reasons.  Even though they seem to be installed?

$ locate dvorak
/usr/share/X11/xkb/keymap/sgi_vndr/dvorak
/usr/share/kbd/keymaps/i386/dvorak
/usr/share/kbd/keymaps/i386/dvorak/ANSI-dvorak.map.gz
/usr/share/kbd/keymaps/i386/dvorak/dvorak-l.map.gz
/usr/share/kbd/keymaps/i386/dvorak/dvorak-prof.map.gz
/usr/share/kbd/keymaps/i386/dvorak/dvorak-r.map.gz
/usr/share/kbd/keymaps/i386/dvorak/dvorak.map.gz
/usr/share/kbd/keymaps/i386/dvorak/no.map.gz
/usr/share/kbd/keymaps/mac/all/mac-dvorak.map.gz
/usr/share/kbd/keymaps/sun/sundvorak.map.gz
/usr/share/vim/keymap/russian-dvorak.vim
/usr/share/vim/keymap/ukrainian-dvorak.vim
/usr/share/vim/macros/dvorak

I don't understand!  If any one of you got an idea, I'd be really thankful.

Cheers,
Thomas

Offline

#4 2009-05-17 08:54:24

sveri80
Member
Registered: 2008-11-12
Posts: 38

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

Hi Thomas,

i am a native german too and some time ago i found the dvorak thing and was very fascinated.
Especially when i saw the one for programmers. However, i spent one day fiddling around with
keyboard layouts, googling about it etc.
At least i took another Approach.
In the file
/usr/share/X11/xkb/symbols/de
you can find the layout for germand dvorak, i adopted everything
to fit my needs. But what was not possible in there was to make
the "b" key on my keyboard act as Backspace so i called for xmodmap
and created a .xmodmap file in my home folder.
And while i was playing i decided to remap the escape function to the
the caps lock key and vice versa.
So everything i wanted was possible with that approach.

I start it all with:
setxkbmap -model pc105 -layout de -variant dvorak
xmodmap ~/.xmodmap


Here is the relevant part of the symbols/de file:

// German Dvorak keymap by Thorsten Staerk (www.staerk.de/thorsten)
// Have acute and grave as dead keys, tilde and circumflex alive as they are needed 
// in many programming languages.                                                   
// to use this keymap, use a 105-key-keyboard and the command setxkbmap -model pc105 -layout dvorak -variant de
// source: http://www-lehre.informatik.uni-osnabrueck.de/~rfreund/dvorak.php                                   
partial alphanumeric_keys                                                                                      
xkb_symbols "dvorak" {                                                                                         
    include "us(dvorak)"                                                                                       

    name[Group1]="Germany - Dvorak";

    key <TLDE> { [ dollar,          asciitilde                       ] };

    key <AE01> { [ ampersand,       percent                       ] };
    key <AE02> { [ bracketleft,     7, apostrophe                                  ] };
    key <AE03> { [ braceleft,       5, bar                                     ] };    
    key <AE04> { [ braceright,      3, less                                      ] };  
    key <AE05> { [ parenleft,       1, greater                                  ] };   
    key <AE06> { [ equal,           9, quotedbl                                  ] };         
    key <AE07> { [ asterisk,        0                                           ] };          
    key <AE08> { [ parenright,      2                                  ] };                   
    key <AE09> { [ plus,            4                                           ] };          
    key <AE10> { [ bracketright,    6                                           ] };          
    key <AE11> { [ exclam,          8,              exclamdown                  ] };          
    key <AE12> { [ numbersign,      grave,          dead_grave                  ] };          

    key <AD01> { [ udiaeresis, Udiaeresis, apostrophe ] };
    key <AD02> { [ comma, semicolon, less ] };            
    key <AD03> { [ period, colon, greater ] };            
        key <AD04> { [ p, P, quotedbl ] } ;               
        key <AD05> { [ y, Y, bar ] } ;                    
    key <AD08> { [ c, C, copyright, Cacute ] };           
    key <AD09> { [ t, T, trademark ] };                   
    key <AD10> { [ z, Z, zabovedot, Zabovedot ] };        
    key <AD11> { [ question, ssharp ] };                  
    key <AD12> { [ slash, backslash, dead_acute ] };      

    key <AC01> { [ a, A, at, aogonek ] };
    key <AC02> { [ o, O, asciicircum, Oacute ] };
    key <AC03> { [ e, E, EuroSign, eogonek ] };  
    key <AC04> { [ i, I ] };                     
    key <AC05> { [ u, U ] };                     
    key <AC06> { [ h, H ] };                     
    key <AC07> { [ d, D ] };                     
    key <AC08> { [ r, R, registered ] };         
    key <AC09> { [ n, N, nacute, Nacute ] };     
    key <AC10> { [ s, S, sacute, Sacute] };      
    key <AC11> { [ l, L, lstroke, Lstroke ] };   

    key <AB01> { [ odiaeresis, Odiaeresis ] };
    key <AB02> { [ q, Q, at ] };              
    key <AB06> { [ x, X ] };                  
    key <AB07> { [ b, B ] };                  
    key <AB08> { [ m, M, mu ] };              
    key <AB09> { [ w, W ] };                  
    key <AB10> { [ v, V ] };                  

    key <BKSL> { [ minus, underscore, hyphen, diaeresis] };

    key <LSGT> { [ adiaeresis, Adiaeresis, bar ] };

    include "level3(ralt_switch)"
};

And here goes my .xmodmap:

keycode  56 = BackSpace
keycode  9 = Caps_Lock
keycode  66 = Escape


keycode 27 = p P p P quotedbl
keycode 28 = y Y y Y bar

keycode 31 = c C c C copyright Cacute
keycode 32 = t T t T trademark

keycode 38 = a A a A at
keycode 39 = o O o O asciicircum
keycode 40 = e E e E EuroSign

keycode 45 = r R r R registered

keycode 52 = odiaeresis Odiaeresis Home Home Home
keycode 53 = q Q q Q End End End
keycode 54 = j J j J Prior Prior
keycode 55 = k K k K Next Next

clear Lock
add Lock = Caps_Lock

Some things are redundant, but i was to lazy to delete them.
Maybe this helps you to achieve what you want.

And i think you may have to adapt some keys to the correct
keycode, depending on your keyboard.

You can find the correct keycode with 'xev'.

Offline

#5 2009-05-20 15:01:13

friedrich
Member
Registered: 2009-05-07
Posts: 26

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

Hi everyone,

Ok, problem solved.  I used to have an Ubuntu System on my laptop before I switched to Arch Linux (so much better;).  On that Ubuntu, I did in fact do something very similar to sveri80 (thanks for the reply).  However, my fundamental misjudgement was that I thought when using HAL to configure the keyboard map it would search the key maps in:

/usr/share/kbd/keymaps/i386/dvorak/

But this is so not the case.  It actually looks for key maps in the very same folders for as the X-Server does.  On an Arch Linux System this is the directory:

/usr/share/X11/xkb/symbols/

In this folder I saved the following text file under the name "dvorakx":

// Dvorak X Adaption by Thomas Friedrich (www.suud.de)
// X = Haskell, Vim, Emacs, LaTeX, Lisp, Xmonad
// To use this keymap, use a 105-key-keyboard and change
// your xorg.conf to
//
// Section "InputDevice"
//      Identifier      "Generic Keyboard"
//      Driver          "kbd"
//      Option          "XkbRules"      "xorg"
//      Option          "XkbModel"      "pc105"
//      Option          "XkbLayout"     "dvorakx"
// EndSection
//
partial alphanumeric_keys
xkb_symbols "dvorakx" {

    name[Group1]= "Dvorak X Adaption";

    // Alphanumeric section

    key <ESC>  { [ Caps_Lock ] };

    // Keyboard row number: +2
    key <TLDE> { [ Tab, ISO_Left_Tab, Tab, ISO_Left_Tab ] };
    key <AE01> { [ Super_L, Hyper_L, Super_L, Hyper_L ] };
    key <AE02> { [ 7, trademark ] };
    key <AE03> { [ 5, copyright ] };
    key <AE04> { [ 3, registered ] };
    key <AE05> { [ 1, section ] };
    key <AE06> { [ 9, parenleft ] };
    key <AE07> { [ 0, parenright ] };
    key <AE08> { [ 2, EuroSign ] };
    key <AE09> { [ 4, sterling ] };
    key <AE10> { [ 6, dollar ] };
    key <AE11> { [ 8, cent] };
    key <AE12> { [ Escape, Escape, Escape, Escape ] };

    // Keyboard row number: +1
    key <TAB>  { [ Alt_L, Meta_L, Alt_L, Meta_L ] };
    key <AD01> { [ udiaeresis, Udiaeresis, bracketleft ] };
    key <AD02> { [ comma, semicolon, plus ] };
    key <AD03> { [ period, colon, dollar ] };
    key <AD04> { [ p, P, bracketright ] };
    key <AD05> { [ y, Y, slash ] };
    key <AD06> { [ f, F, backslash ] };
    key <AD07> { [ g, G, braceleft ] };
    key <AD08> { [ c, C, backslash ] };
    key <AD09> { [ r, R, dollar ] };
    key <AD10> { [ l, L, braceright ] };
    key <AD11> { [ apostrophe, quotedbl ] };
    key <AD12> { [ question, exclam ] };

    // Keyboard row number: 0
    key <CAPS> { [ Control_L, Control_L ] };
    key <AC01> { [ a, A, asciicircum, dead_circumflex ] };
    key <AC02> { [ o, O, less ] };
    key <AC03> { [ e, E, minus ] };
    key <AC04> { [ u, U, greater ] };
    key <AC05> { [ i, I, parenleft ] };
    key <AC06> { [ d, D, parenright ] };
    key <AC07> { [ h, H, grave, dead_grave ] };
    key <AC08> { [ t, T, ampersand ] };
    key <AC09> { [ n, N, acute, dead_acute ] };
    key <AC10> { [ s, S, at ] };
    key <AC11> { [ ssharp, slash ] };
    key <BKSL> { [ minus, underscore, bar, brokenbar ] };

    // Keyboard row number: -1
    key <LSGT> { [ adiaeresis, Adiaeresis, bar, brokenbar ] };
    key <AB01> { [ odiaeresis, Odiaeresis, asciitilde, dead_tilde ] };
    key <AB02> { [ q, Q, colon ] };
    key <AB03> { [ j, J, equal ] };
    key <AB04> { [ k, K, asterisk ] };
    key <AB05> { [ x, X ] };
    key <AB06> { [ b, B ] };
    key <AB07> { [ m, M, numbersign ] };
    key <AB08> { [ w, W, percent ] };
    key <AB09> { [ v, V, degree ] };
    key <AB10> { [ z, Z, section ] };

    // Keyboard row number: -2
    key <LCTL> { [ Caps_Lock ] };
    key <SPCE> { [ space, Escape, space, Escape ] };

    include "level3(ralt_switch)"
};

Its honestly the best layout for coding Haskell and LaTex-files ever ;)  @sveri80: You should definitely try it out.  You will realise that stuff like ->, <-, $\, $\{, (), $ and other stuff are really easy to type, WITHOUT your hands moving around the keyboard too much (not at all in fact.)  I use Emacs a lot, so having the Control and Alt key close is more than convenient.  When using Vim I use S-space to invoke Escape.  Within Bash or Emacs, I use C-i for tab-completion and for indentations.  For invoking Enter I mainly use C-m.

Don't move your hand, move your fingers ;)

Happy Hacking,
Thomas

Last edited by friedrich (2009-05-20 15:03:44)

Offline

#6 2009-05-20 15:23:09

sveri80
Member
Registered: 2008-11-12
Posts: 38

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

Thank you for the hints, i even tried it out, but i think i am to lazy to learn another layout again.
It took me long enough to learn my one ;-)

But what might interest me, did you find out how to map the Backspace function to another
key in such file?
It would be great if i could narrow down my solution to one file like you did.

Offline

#7 2009-05-20 18:56:45

friedrich
Member
Registered: 2009-05-07
Posts: 26

Re: [SOLVED] Not all Dvorak Keybourd Layouts work!

There are two things you could try.  1) You are including us(dvorak) in your key map file.  Hence, us(dvorak) is first in binding the Backspace key and you are second, and for some reasons xorg doesn't like double bindings of some keys.  Your defining everything possible in your key map anyway, so delete this line and try to map the Backspace key again.  2) If this doesn't work, have a look what's going on in level3(ralt_switch).

Offline

Board footer

Powered by FluxBB