Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-13-2020, 09:24 AM   #1
LQ Newbie
Registered: Jul 2015
Posts: 21

Rep: Reputation: Disabled
how to build a keyboard layout file form scrach?

I have been struggling to get a hold of a comprehensive guide how to build a keyboard layout for a couple of days now. I can not find any on the internet.

About xmodmap:
I do not want to use xmodmap. since trying to do so resulted in that my caps lock key were still preforming caps lock function after reassignment. do not know why. but it did not work. Also putting a standard file in /usr/share/X11/symbols seems better.

So does anyone know a comprehensive guide where I can get to know how to reassign function keys as well? Or a book for that matter. When looking in /usr/share/X11/symbols and search for i.e. us I find a lot of files. so US keyboard layouts seems to use a lot of files. I would like to understand how it works also there seems to be references to other files in the files if I'm not mistaken how does that work?

Two systems:
Also the keyboard file for console and X is different so is there an easy way to write one file and convert it to the format of the other?

Is there a program that shows which key I'm pressing i.e. like xev but for the syntax that is used in the keymap files in /usr/share/X11/symbols. i.e. <AC01> = a?

why I'm doing all this is because I want to use ARENSITO for my kinesis keyboard and have a arensito-kinesis.xkb file but do not know how to convert it into the syntax that is used by X or consol for that matter.

So If you have a suggestion about how to solve the problem by using the xkb file I would be all ears as well. >)

linux distro: KDE-neon (latest) basically kubuntu

Thanks for your help!

Last edited by Johannes33; 05-13-2020 at 09:34 AM.
Old 05-13-2020, 11:15 AM   #2
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,553

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
The file arensito-kinesis.xkb is ready to use, but it needs to be saved as /usr/share/X11/xkb/keycodes/evdev. First rename the existing file as evdev.bak — if anything goes wrong, you'll need it back! After saving the file, log out and in again and things should just work — if the file has no errors.

The console files are very different. The location varies, but you could try
The file …qwerty/ will show you what they should look like — obviously you are going to have to write the new file by hand. Note the include statements at the start — these files will also have to be altered.

Last edited by DavidMcCann; 05-13-2020 at 11:16 AM.
Old 05-13-2020, 12:51 PM   #3
LQ Newbie
Registered: Jul 2015
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks a lot for the information!!
After I change it's name to evdev is it still possible to change key map in the settings in KDE or do I have to use evdev.bak to toggle between key maps?
Since you seem to know some things about keymaps, do you know how it works with function keys?
I read somewhere that above (I think it was F70) a certain number one can use they without collision. like 192.168 in networks. Do you know if it was F70 or if it was from F13 to F70?

Also do you know where I can read about the syntax of the normal key layout file, in my example it was named us.

Last edited by Johannes33; 05-14-2020 at 02:14 AM.
Old 05-14-2020, 11:55 AM   #4
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,553

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
The desktops are designed to enable you to switch languages, not hardware. If a keyboard is identified as a PC one when you boot the computer, then it will select evdev — otherwise one of the other files in keycodes/.

The system works by matching the hardware file in keycodes/ to one or more of the files in symbols/. So, on a PC the first key in the home row is 38, but on a Mac it's 8. Those codes are replaced by AC01 — alphanumeric area, row c (third up), first key. The language drivers in symbols/ then replace AC01 with the code for the appropriate letter — a in QWERTY or q in AZERTY. All the files are considered to be C source code — ence the final semicolons.

The approach that the website recommended rewrote the evdev file so that the English language file would work with it. The better approach would be to use that adopted for a Dvorak keyboard, which you can see in the file symbols/us, where you adapt the language file. If you want to switch keyboards, that would be the way to do it. Create a driver in symbols, with the keys in the right places. So the QWERTY driver has
key <AC02> { [ s, S ] };
and the Dvorak one has
key <AC02> { [ o, O ] };
and your system would need
key <AC02> { [ r, R ] };

Using that approach, you can stay with the original evdev file. The new section in the us file can be treated as a variant. The desktop won't know about it, so you may have to edit its configuration files manually. In my Xfce configuration, I have the line
<property name="XkbLayout" type="string" value="gb,astro,gr"/>
where I had to insert astro manually because it's my own invention.

I don't know how many function keys can be created, but the IBM mainframe terminals have 24.


keyboard layout, xkb

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting the correct keyboard layout corresponding to my laptop's physical layout nidra Linux - Newbie 2 08-28-2017 08:14 AM
make an install cd of my linux from scrach toure32 Linux From Scratch 4 05-21-2010 06:49 AM
Switching keyboard layout - Mandriva2006 - K.D.E. Windows Layout! itz2000 Mandriva 3 08-13-2006 06:43 PM
start form scrach what is the best seure directory structure to use? crashedspine Linux - Security 2 06-23-2004 05:33 PM
Login and password program for linux from scrach, suggestion's welcomed. Tarts Programming 5 08-03-2003 07:40 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration