LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-30-2008, 07:43 PM   #1
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Rep: Reputation: 31
editing keyboard layout (foreign languages)


I'm trying to create a keyboard layout that is a not the conventional layout but rather a handy and somewhat popular phonetic layout.
I am not too familiar with how Linux handles font switchings but here is how I enabled a second language in my xorg.conf, Russian is used in this example:
Code:
Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "keyboard"
    Option         "XkbLayout" "us,ru"
    Option         "XkbOptions" "grp:ctrl_shift_toggle, grp_led:scroll"
EndSection
The above enables 2 layouts, US English and "basic" Russian, CTRL+SHIFT toggles between the layouts, Scroll Lock keyboard LED gets toggled when layouts are switched.
Now conventionally the layouts are stored in *somewhere*/xkb/symbols/ which in my case is /etc/X11/xkb/symbols/, and in my case the layout file is "ru". I found a premade phonetic version on the web, and replaced the current one with it. Found here http://www.jhindin.com/programs/XFreeCyrPhonetic/ This is my new /etc/X11/xkb/symbols/ru :
Code:
// $TOG: ru /main/4 1997/06/10 06:56:17 kaleb $
//
// russian standard keyboard 
// AEN <aen@logic.ru>
//
// $XFree86: xc/programs/xkbcomp/symbols/ru,v 3.6 1999/04/11 13:11:25 dawes Exp $

partial default alphanumeric_keys 
xkb_symbols "basic" {

    // Describes the differences between a very simple en_US
    // keyboard and a very simple Russian keybaord

    name[Group1]= "US/ASCII";
    name[Group2]= "Russian Phonetic";

    key	<TLDE> {	[	    grave,	asciitilde	],
			[     Cyrillic_yu,     Cyrillic_YU	]	};
    key	<LSGT> {	[	     less,	   greater	],
			[	      bar,	 brokenbar	]	};

    key	<AD01> {	[		q,		 Q	],
			[ Cyrillic_ya,       Cyrillic_YA	]	};

    key	<AE01> {	
[		1,	    exclam	],
			[		1,	    exclam 	]	};

    key	<AB01> {	[		z,		 Z	],
			[     Cyrillic_ze,     Cyrillic_ZE	]	};

    key	<AC02> {	[		s,		 S	],
			[     Cyrillic_es,     Cyrillic_ES	]	};

    key	<AC01> {	[		a,		 A	],
			[      Cyrillic_a,       Cyrillic_A	]	};

    key	<AD02> {	[		w,		 W	],
			[     Cyrillic_ve,     Cyrillic_VE	]	};

    key	<AE02> {	[		2,		at	],
			[		2,        quotedbl	]	};

    key	<AB03> {	[		c,		 C	],
			[    Cyrillic_tse,    Cyrillic_TSE	]	};

    key	<AB02> {	[		x,		 X	],
			[Cyrillic_softsign,Cyrillic_SOFTSIGN	]	};

    key	<AC03> {	[		d,		 D	],
			[     Cyrillic_de,     Cyrillic_DE	]	};

    key	<AD03> {	[		e,		 E	],
			[     Cyrillic_ye,     Cyrillic_YE	]	};

    key	<AE04> {	[		4,	    dollar	],
			[		4, Cyrillic_HARDSIGN  	]	};

    key	<AE03> {	[		3,	numbersign	],
			[		3,   Cyrillic_hardsign	]	};

    key	<AB04> {	[		v,		 V	],
			[    Cyrillic_zhe,     Cyrillic_ZHE	]	};

    key	<AC04> {	[		f,		 F	],
			[     Cyrillic_ef,     Cyrillic_EF	]	};

    key	<AD05> {	[		t,		 T	],
			[     Cyrillic_te,     Cyrillic_TE	]	};
 
   key	<AD04> {	[		r,		 R	],
			[     Cyrillic_er,     Cyrillic_ER	]	};

    key	<AE05> {	[		5,	   percent	],
			[		5,	     colon	]	};

    key	<AB06> {	[		n,		 N	],
			[     Cyrillic_en,     Cyrillic_EN	]	};

    key	<AB05> {	[		b,		 B	],
			[     Cyrillic_be,     Cyrillic_BE	]	};

    key	<AC06> {	[		h,		 H	],
			[     Cyrillic_ha,     Cyrillic_HA	]	};

    key	<AC05> {	[		g,		 G	],
			[    Cyrillic_zhe,    Cyrillic_ZHE	]	};

    key	<AD06> {	[		y,		 Y	],
			[   Cyrillic_yeru,      Cyrillic_YERU	]	};

    key	<AE06> {	[		6,     asciicircum	],
			[		6,     Cyrillic_io	]	};
    key	<AB07> {	[		m,		 M	],
			[      Cyrillic_em,    Cyrillic_EM	]	};
    key	<AC07> {	[		j,		 J	],
			[ Cyrillic_shorti, Cyrillic_SHORTI	]	};
    key	<AD07> {	[		u,		 U	],
			[    Cyrillic_u,        Cyrillic_U	]	};
    key	<AE07> {	[		7,	 ampersand	],
			[		7,     Cyrillic_IO	]	};
    key	<AE08> {	[		8,	  asterisk	],
			[		8,	 semicolon	]	};
    key	<AB08> {	[	    comma,	      less	],
			[           comma,            less	]	};
    key	<AC08> {	[		k,		 K	],
			[       Cyrillic_ka,     Cyrillic_KA	]	};
    key	<AD08> {	[		i,		 I	],
			[      Cyrillic_i,      Cyrillic_I	]	};
    key	<AD09> {	[		o,		 O	],
			[      Cyrillic_o,      Cyrillic_O	]	};
    key	<AE10> {	[		0,	parenright	],
			[		0,	parenright	]	};
    key	<AE09> {	[		9,	 parenleft	],
			[		9,	 parenleft	]	};
    key	<AB09> {	[	   period,	   greater	],
			[     	   period,         greater	]	};
    key	<AB10> {	[	    slash,	  question	],
			[	    slash,	  question	]	};
    key	<AC09> {	[		l,		 L	],
			[     Cyrillic_el,     Cyrillic_EL	]	};
    key	<AC10> {	[	semicolon,	     colon	],
			[       semicolon,    	     colon	]	};
    key	<AD10> {	[		p,		 P	],
			[     Cyrillic_pe,     Cyrillic_PE	]	};
    key	<AE11> {	[	    minus,	underscore	],
			[	    minus,	underscore	]	};
    key	<AC11> {	[      apostrophe,	  quotedbl	],
			[      apostrophe,	  quotedbl	]	};
    key	<AD11> {	[     bracketleft,	 braceleft	],
			[     Cyrillic_sha,   Cyrillic_SHA	]	};
    key	<AE12> {	[	    equal,	      plus	],
			[    Cyrillic_che,    Cyrillic_CHE	]	};
    key	<AD12> {	[    bracketright,	braceright	],
			[  Cyrillic_shcha,  Cyrillic_SHCHA	]	};
    key	<BKSL> {	[	backslash,	       bar	],
			[      Cyrillic_e,      Cyrillic_E	]	};

    // End alphanumeric section
    
    // Begin modifier mappings 

    modifier_map Shift  { Shift_L };
    modifier_map Lock   { Caps_Lock, ISO_Lock };
    modifier_map Control{ Control_L };
    modifier_map Mod3   { Mode_switch };
};

partial alphanumeric_keys
xkb_symbols "winkeys" {
    include "ru(basic)"
    key	<AE04> {	[		4,	    dollar	],
			[		4,       semicolon	]	};
    key	<AE03> {	[		3,	numbersign	],
			[		3,      numbersign	]	};
    key	<AE05> {	[		5,	   percent	],
			[		5,	   percent	]	};
    key	<AE06> {	[		6,     asciicircum	],
			[		6,	     colon	]	};
    key	<AE07> {	[		7,	 ampersand	],
			[		7,	  question	]	};
    key	<AE08> {	[		8,	  asterisk	],
			[		8,	  asterisk	]	};
    key	<AB10> {	[	    slash,	  question	],
			[	   period,	     comma	]	};
    key	<BKSL> {	[	backslash,	       bar	],
			[	    slash,             bar	]	};
};
Unfortunately changes to this file make absolutely no effect on active layout after restarting X or rebooting the system.
First thing I checked was any obvious alternate locations that X could be using, but the following
Code:
updatedb
locate symbols/ru
returns only the above location. However I managed to find 2 linked locations to my /etc/X11, /usr/X11R6/lib/X11 and /usr/X11/lib/X11.
All point to the same files, including to the one I replaced. I have no idea where else the active layouts could be stored.
What am I doing wrong? Where does the system keep the layouts if not where I'm editing them?
All help is appreciated.

PS A final note, most new distros already include a "phonetic" layout, which was in the old file I replaced. Since this isn't the variation of phonetic layout that I can type on, I tried editing it with no result, and then replaced with the downloaded layout you see above.
 
Old 05-31-2008, 05:54 PM   #2
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,126

Rep: Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792
I'm not quite clear about the promlem. Are you saying that Ctrl+Sh is not toggling between layouts? If so, then perhaps you should be using the facilities in your desktop rather than editing a configuration file by hand. Using the Gnome desktop, I have the keyboard indicator on a panel and it enables me to add or remove keyboards, swap between them, change the default, etc. I wouldn't even know if I had an xorg.conf!
 
Old 05-31-2008, 11:23 PM   #3
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by DavidMcCann View Post
I'm not quite clear about the promlem. Are you saying that Ctrl+Sh is not toggling between layouts? If so, then perhaps you should be using the facilities in your desktop rather than editing a configuration file by hand. Using the Gnome desktop, I have the keyboard indicator on a panel and it enables me to add or remove keyboards, swap between them, change the default, etc. I wouldn't even know if I had an xorg.conf!
As the title of the thread reads, this thread is about editing keyboard layout files. In layman's terms that means assigning letters to buttons.
The problem is that my system is ignoring the layout files at the above location and using layout files from somewhere else, and I have no clue where. The act of toggling works but it isn't the right layout.
I am used to a different variation of keyboard not available on Linux by default, meaning I have to create it.
Hopefully I will get an explanation why my system is ignoring changes to these files before this thread dies.
 
Old 06-04-2008, 04:44 PM   #4
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,126

Rep: Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792Reputation: 792
Forgive me if I'm being a little slow, but I am trying to help -- and no one else is...

So essentially, if you switch from keyboard us or gb to ru, the switch is made but to the original version of ru, not your customised one? In that case just search for any file in /usr (and /etc, if need be) which contains the string "russian keyboard", using the desktop's search facility or grep. If it's there, then it can be found.
 
Old 05-13-2010, 03:56 PM   #5
Esquirol
LQ Newbie
 
Registered: Nov 2009
Location: Russia
Distribution: Mandriva 2010
Posts: 10

Rep: Reputation: 0
Hello r00tb33r,


have you found the solution?
 
  


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
patch for foreign keyboard layout? lbdgwgt Linux - Kernel 2 10-27-2006 03:57 PM
Fluxbox: Change languages / keyboard layout? BaltikaTroika Linux - Newbie 3 09-25-2006 01:43 PM
Problem with foreign keys on a British layout keyboard eBopBob Suse/Novell 1 06-03-2006 08:31 AM
Keyboard layout problem with different languages Linuxapprentice Fedora 1 02-08-2006 09:47 PM
choosing default keyboard layout in KDE or how to switch languages correctly sensovision Linux - General 3 05-23-2004 04:56 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration