LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2011, 12:01 PM   #1
naena
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Rep: Reputation: 0
Editing / making a keyboard map


Hello all,

I am just entering the Linux world. All these years I wanted to test Linux but did not have the resources to make a new computer. Then I found Puppy Linux by chance. Nearly all the work I do with Windows 7/XP can be done with Puppy Linux. I am running it from a CD.

I developed a smartfont for an Indic language called Sinhala, which uses ISO-8859-1 (Latin-1, SBCS) character set. It makes typing Sinhala, one of the more complex of Indic scripts, easy.

Essentially, this is a transliteration of the 'complex' script into Latin character set and then showing it back in the native script by way of the smartfont. See it here:
http://lovatasinhala.com/

Of course, you have no clue what it says. If you copy the text and look, you'll understand what is going on. You can type it with the dead-key keyboard. Only problem is that in certain situations, the font makes conjoint letters where you don't want them. You can prevent it by inserting the ZWNJ, Zero-width non-joiner (u200C), but the keyboard does not have it. Is there a way to edit the keyboard layout and make a modified key layout?

Thanks.

naena

Last edited by naena; 03-13-2011 at 12:06 PM.
 
Old 03-13-2011, 12:07 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
I've not yet done much with it myself, but you can read all about how the X keyboard works here:

http://www.charvolant.org/~doug/xkb/html/xkb.html

I'm not sure about the console keyboard, however.
 
Old 03-13-2011, 02:02 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,166

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
I may be wrong here, but I don't think this is going to work with Puppy. If it does, please tell us how: I could never get a custom keyboard with Puppy.

Most distros compile the keyboard driver after the user logs in, so that it can be tailored to that user's configuration options. Puppy, as a single-user system, seems to have pre-compiled drivers, like Windows. I could never work out how to create them.

Puppy is a very English-oriented distro. If you had one with better support for Asian languages, you'd find that you'd get a Sinhalese keyboard.

The problem with your approach is that it's what we used to do back in the 80's. Using the modern approach, where the script has its proper place in unicode, means that your files would be accessible to other people, without their needing your special font.

Have a look here:
http://www.linuxquestions.org/questi...on-linux-2570/
 
Old 03-22-2011, 01:31 AM   #4
naena
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Original Poster
Rep: Reputation: 0
I fixed it!
I first followed this doc:
http://hektor.umcs.lublin.pl/~mikosm...youts-xkb.html

Well, this is what is going on:
1.
The files at etc/X11/xkb/symbols/pc define arrangements of keys in different physical keyboards. Make your layout (variation) under the name of the physical keyboard that it applies to (see 2 next)
2.
Each of these have a basic set and then variations below it. e.g. in the 'US' keyboard file, we have 'basic', 'intl', 'alt-intl', 'Dvorak', 'rus'
3.
Each key has its own name either as a nick name like <BKSL> for Backslash or according to its position like <AD03> for 'e' meaning, A=alphanumeric; D=the 4th row counting from the key row having the space bar (being A), row with Shift key being B etc. These names are assigned somewhere that I could not find. Notice however, that the Russian one uses names like <LatA> which are different to this rule.
4.
Each type of key is categorized into how many shifted states it can take. e.g. Enter key has only one shifted state, but an alphabetic like 'a' can have four (Unshifted, Shift, AltGr and Ctrl)
5.
All resulting characters have there own name defined somewhere, which too I could not locate. e.g. &=ampersand, Left Parentheses = parenleft

=============
Okay, my problem was:
I want to define a keymap that incorporates ZWNJ (Zero width non-joiner) which is Unicode code point u200C. What is it's given name in Ubuntu? (I have version 10.4 code name Lucid).

Pascal says you could use the Unicode notation u200C, but it did not work! After days of testing I noticed that changes do not stick and you are reverted to the old layout. So, I looked around under XKB if there is anything that was caused to be written by me (checking the file dates). There were number of files in side etc/X11/xkb/compiled folder. Actually, that is a link to a folder elsewhere. I deleted the files and my keyboard worked as soon as an X server Restart!

Change your keyboard to something other than the one you are editing. Otherwise it would be read-only. I edited US while in UK. I believe that we do not need to use all the silly names of keys. Instead, we can be a bit modern and use Unicode codepoints like this:
key <AD01> { [ u0071, u0051, u00E4, u00C4 ] };
is same as:
key <AD01> { [ q, Q, adiaeresis, Adiaeresis ] };

(I accidentally saved this, but thought I lost it. Then I wrote the next one. Both these posts say essentially the same thing)

Last edited by naena; 03-22-2011 at 10:05 AM. Reason: Minor: Corrected shifted states list and some
 
Old 03-22-2011, 02:51 AM   #5
naena
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Original Poster
Rep: Reputation: 0
I fixed it. Here's how

Thanks to Pascal:
http://hektor.umcs.lublin.pl/~mikosm...youts-xkb.html

What I learned:
1.
etc/X11/xkb/symbols/pc has definition of physical layout of different keyboards
e.g. US, IN, LK.
2.
Each keyboard has a default set and its variations below it. e.g. US has 'basic', 'intl', 'alt-intl' and 'rus'. I added 'sinhala'
3.
Each key has a nick name (e.g. <BKSL> for Backslash, or one made according to type and position. e.g. <AE03>: A=alphanumeric; E=Fifth row from the row having the space bar (=A), 03=third alphanumeric key counting from left.
3.
Each character produced has an assigned name defined somewhere that I could not find. e.g. $=dollar. 3=3, -=minus
We can use the Unicode codepoint for each of the characters like $=u0024, 3=u0033, -=u002D
Unicode code points: http://www.unicode.org/charts/
4.
include "level3(ralt_switch)" means we are using AltGr key at the third position of a key definition row.
5.
Key positions in a row: Unshifted, Shifted, AltGr, Ctrl
e.g. key <AB08> { [ comma, less, ccedilla, Ccedilla ] };
6.
Stay in a different keyboard than the one you are editing. Otherwise, the definition file would be read-only.
e.g. Use UK when editing US.
7.
A typo will cause you unable to type anything with the new layout.
8.
Mostly, you are making a layout variant under a given physical keyboard. Therefore, if the physical keyboard you are using is the US keyboard, add your definition to the US file. (See the attachment)
9.
When you have finished editing, delete the files in the 'compiled' folder:
(Puppy Linux:) etc/X11/xkb/compiled
***This step is important to avoid days of frustration.***
10.
Restart X server and set up the Keyboard and the new variant you made.
e.g.. (Puppy Linux:) Menu -> Setup -> Mouse/Keyboard wizard ->
Chose layout... -> Advanced Xorg... -> Layout Variants
(read instructions carefully. You might set the wrong variant if not careful.

See the attachment for my work -- the bottom most one. Actually, it ('sinhala') defers from 'intl' only in the bottom two rows.

Thank you for the responses. It took me days to figure out all this. So pardon me for late return here.
Attached Files
File Type: txt us.txt (15.8 KB, 10 views)
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
keyboard map : not as I think it should be esteeven Linux - General 3 03-13-2011 02:19 PM
Keyboard Map UltraSoul *BSD 1 02-08-2005 12:21 PM
keyboard map logicport Linux - Software 1 07-27-2004 12:45 AM
Keyboard map? Gerardoj Linux - Hardware 0 09-29-2003 10:46 PM
Keyboard Map Gerardoj Linux - General 2 08-07-2003 03:57 PM


All times are GMT -5. The time now is 06:23 PM.

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