LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 12-09-2007, 06:41 AM   #1
drobert
LQ Newbie
 
Registered: Dec 2007
Location: Budapest, Hungary
Distribution: Fedora Core 11
Posts: 10

Rep: Reputation: 0
Question problem creating custom xkb layout


Hi all!

I have a Hungarian keyboard by default, but I need to type some French letters without changing the layout, so I decided to create my own.
(Fedora Core 8)

Reading the internet I found these:
- I created a new file as /usr/share/X11/xkb/symbols/hu_fr ,file shown at bottom
- I have added 2 lines to /usr/share/X11/xkb/rules/base.lst:
under ! layout
hu_fr Hungary+french
under ! variant
standard hu_fr: Standard
- after that I executed in /usr/share/X11/xkb/symbols
xkbcomp -lhlpR '*' -o ../symbols.dir

After doing that, I havent found any new layouts, and Nautilus won't start.
Removing new file and changes to base.lst and running a xkbcomp command corrects the previous state.

File: hu_fr

// Default layout
default partial
xkb_symbols "basic_fr" {
include "hu(102_qwertz_comma_dead_fr)"
name[Group1] = "Hungary - French";
};

// 102_qwertz_comma_dead_fr
// 102 key qwertz french layout
// with decimal comma on keypad
// and with dead key support
partial
xkb_symbols "102_qwertz_comma_dead_fr" {
name[Group1] = "Hungary - 102/qwertz/comma/Dead keys FR";
include "latin"
include "hu_fr(def_102_fr)"
include "hu_fr(def_qwertz_fr)"
include "kpdl(comma)"
include "hu_fr(def_dead_fr)"
include "hu_fr(def_common_fr)"
include "level3(ralt_switch)"
};

// def_102_fr:
// The standard Hungarian 102 key + french layout
hidden partial alphanumeric_keys
xkb_symbols "def_102_fr" {
key <TLDE> { [ 0, section, notsign ] };
key <LSGT> { [ iacute, Iacute, less, greater ] };

};

// def_qwertz_fr:
// The standard Hungaryan qwertz + french layout
hidden partial alphanumeric_keys
xkb_symbols "def_qwertz_fr" {
key <AD06> { [ z, Z ] };
key <AB01> { [ y, Y, greater ] };
};

// def_dead_fr:
// Dead keys support part
hidden partial alphanumeric_keys
xkb_symbols "def_dead_fr" {
key <AE01> { [ 1, apostrophe, asciitilde, dead_tilde ] };
key <AE02> { [ 2, quotedbl, dead_caron, caron ] };
key <AE03> { [ 3, plus, asciicircum, dead_circumflex ] };
key <AE04> { [ 4, exclam, dead_breve, breve ] };
key <AE05> { [ 5, percent, dead_abovering, degree ] };
key <AE06> { [ 6, slash, dead_ogonek, ogonek ] };
key <AE07> { [ 7, equal, grave, dead_grave ] };
key <AE08> { [ 8, parenleft, dead_abovedot, abovedot ] };
key <AE09> { [ 9, parenright, dead_acute, acute ] };
key <AE10> { [ odiaeresis, Odiaeresis, dead_doubleacute, doubleacute ] };
key <AE11> { [ udiaeresis, Udiaeresis, dead_diaeresis, diaeresis ] };
key <AE12> { [ oacute, Oacute, dead_cedilla, cedilla ] };
};

// def_common_fr:
hidden partial alphanumeric_keys
xkb_symbols "def_common_fr" {
key <AD01> { [ q, Q, backslash ] };
key <AD02> { [ w, W, bar ] };
key <AD03> { [ e, E, egrave, Egrave ] };
key <AD07> { [ u, U, EuroSign ] };
key <AD08> { [ i, I, Iacute, iacute ] };
key <AD11> { [ odoubleacute, Odoubleacute, division ] };
key <AD12> { [ uacute, Uacute, multiply ] };

key <AC01> { [ a, A, adiaeresis, Adiaeresis ] };
key <AC02> { [ s, S, dstroke ] };
key <AC03> { [ d, D, Dstroke ] };
key <AC04> { [ f, F, bracketleft ] };
key <AC05> { [ g, G, bracketright ] };
key <AC07> { [ j, J, iacute, Iacute ] };
key <AC08> { [ k, K, lstroke ] };
key <AC09> { [ l, L, Lstroke ] };
key <AC10> { [ eacute, Eacute, dollar, cent ] };
key <AC11> { [ aacute, Aacute, ssharp ] };

key <BKSL> { [ udoubleacute, Udoubleacute, currency ] };

key <AB02> { [ x, X, numbersign ] };
key <AB03> { [ c, C, ampersand ] };
key <AB04> { [ v, V, at ] };
key <AB05> { [ b, B, braceleft ] };
key <AB06> { [ n, N, braceright ] };
key <AB07> { [ m, M, less ] };
key <AB08> { [ comma, question, semicolon ] };
key <AB09> { [ period, colon, greater ] };
key <AB10> { [ minus, underscore, asterisk ] };

};


Any idea?

Robert
 
Old 12-12-2007, 02:12 PM   #2
DennisC31
Member
 
Registered: May 2007
Location: beyond my means
Distribution: Mint 11.04
Posts: 55

Rep: Reputation: 19
Mon dieu, je me sens désolé pour toi.

But, I'll write in english for our other friends here.

Quote:
under ! layout
hu_fr Hungary+french
under ! variant
standard hu_fr: Standard
- after that I executed in /usr/share/X11/xkb/symbols
xkbcomp -lhlpR '*' -o ../symbols.dir
Don't change anything in the rules file. I know it may be cleaner to do it this way, but it may not be easier.

backup your /symbols/hu file.

Now, I assume that since you are using the hu layout that you are already familiar with the term ALTGR. That's the right alt key and it's used with non-english languages where there are ciromflexes and cedillas and accents, etc.

In the hu file, the altGR key is the 3rd field. You will have to add what you want that key to do in the 3rd field.

For instance, to get an accent grave with the "comma, question, semicolon" key:

key <AB08> { [ comma, question, grave ] };

Unfortunately, this means having to lose whatever was stored there in the first place.

You may want to check under system, preferences, keyboard, layouts (or something similar in Gnome / KDE) and add the french layout.

There's a way, somewhere in there, to setup changing from one layout to another.

You also may want to install SCIM. SCIM will give you a nifty menu to use to switch between layouts and it may also give you a way to hit 2 keys like alt+shift to switch between types.

This is the file that I use for an english dvorak layout with dead keys for many french (and other language) symbols:
/usr/share/X11/xkb/symbols/us

Last edited by DennisC31; 04-11-2012 at 05:41 PM. Reason: added link
 
Old 12-13-2007, 02:46 PM   #3
drobert
LQ Newbie
 
Registered: Dec 2007
Location: Budapest, Hungary
Distribution: Fedora Core 11
Posts: 10

Original Poster
Rep: Reputation: 0
Well, merci beaocoup!

The fourth entry is what you can get by pressing AltGr + Shift (or CapsLock). I have already modified my 'hu' file that way that every acoute character has a circumflex (AltGr) pair, and every simple vowel has a grave pair in AlgGr.

I think this rather a workaround, but it works and i may not need any seperate layout, because i use this layout all the time.

Thanks once more!

P.s. Of course after changes to a layout file, running
xkbcomp -lhlpR '*' -o ../symbols.dir
is needed! Otherwise X will hang on next start.
 
Old 06-28-2008, 08:21 PM   #4
smyrman
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by drobert View Post
Hi all!

- after that I executed in /usr/share/X11/xkb/symbols
xkbcomp -lhlpR '*' -o ../symbols.dir

Robert
You my try:

# cd /usr/share/X11/xkb/symbols
# xkbcomp symbols/<layout>

xkbcomp will now tell you if there is something wrong in your <layout> file..

At least this solved my issues.
 
  


Reply

Tags
create, layout, xkb



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
Creating custom headers to match a custom kernel utanja Debian 2 06-08-2007 03:15 PM
Creating a Custom Kernel BlackSheep024 Ubuntu 3 06-05-2007 08:55 PM
Creating a custom distrobution xaos5 Linux - General 1 03-06-2007 10:12 PM
creating a business card layout in linux. dr_zayus69 Linux - Software 7 02-16-2005 09:16 PM
xkb layout changing Ipolit *BSD 3 02-03-2004 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:56 AM.

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
Open Source Consulting | Domain Registration