LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-26-2014, 03:41 PM   #1
cin_
Member
 
Registered: Dec 2010
Posts: 281

Rep: Reputation: 24
xkb and utf-8


i want a way to visualise international keyboard layouts with each button's utf-8 equivalent

i figured xkb would be a great resource in mocking this up but the files therein use a syntax i am having trouble finding any information about

thought i'd reach out for some ideas on how to begin tackling this..

here is an example bit from /user/share/X11/xkb/symbols/jp:
Code:
...
    key <AE01> { [ kana_NU    ] };
    key <AE02> { [ kana_FU    ] };
    key <AE03> { [ kana_A, kana_a ] };
    key <AE04> { [ kana_U, kana_u ] };
    key <AE05> { [ kana_E, kana_e ] };
    key <AE06> { [ kana_O, kana_o ] };
    key <AE07> { [ kana_YA, kana_ya ] };
    key <AE08> { [ kana_YU, kana_yu ] };
    key <AE09> { [ kana_YO, kana_yo ] };
    key <AE10> { [ kana_WA, kana_WO ] };
    key <AE11> { [ kana_HO    ] };
    key <AE12> { [ kana_HE    ] };
    key <AE13> { [ prolongedsound ] };

    key <AD01> { [ kana_TA    ] };
    key <AD02> { [ kana_TE    ] };
    key <AD03> { [ kana_I, kana_i ] };
    key <AD04> { [ kana_SU    ] };
    key <AD05> { [ kana_KA    ] };
    key <AD06> { [ kana_N   ] };
    key <AD07> { [ kana_NA    ] };
...
here's /user/share/X11/xkb/symbols/es:
Code:
    key <AC01> {[          a, A, ae, AE         ]};
    key <AC02> {[          o, O, oslash, Oslash       ]};
    key <AC03> {[          e, E, EuroSign       ]};
    key <AC04> {[          u, U, aring, Aring       ]};
    key <AC05> {[          i, I, oe, OE         ]};
    key <AC06> {[          d, D, eth, ETH       ]};
    key <AC07> {[          r, R, registered, trademark      ]};
    key <AC08> {[          t, T, thorn, THORN       ]};
    key <AC09> {[          n, N, eng, ENG       ]};
    key <AC10> {[          s, S, ssharp, section      ]};
    key <AC11> {[ dead_acute, dead_diaeresis, braceleft, dead_tilde ]};
    key <BKSL> {[   ccedilla, Ccedilla, braceright, dead_cedilla  ]};

    key <LSGT> {[       less, greater, guillemotleft, guillemotright  ]};
    key <AB01> {[      minus, underscore, hyphen, macron    ]};
    key <AB02> {[
how can i map those key definitions to utf?
after failing to find a quick and easy way i thought maybe i just switch my layout, type the character then do a decode..maybe?
seems unnecesarily annoying and liable to miss a key

again, any thoughts?

Last edited by cin_; 05-26-2014 at 03:43 PM. Reason: gramm`err
 
Old 05-27-2014, 08:05 AM   #2
cin_
Member
 
Registered: Dec 2010
Posts: 281

Original Poster
Rep: Reputation: 24
found it

some digging through X11 resources and i think i have found the reference sheet for these symbol names:

Code:
/usr/include/X11/keysymdef.h
an example covering some of the jp ones listed in the original post..
Code:
 862: #define XK_kana_NU                                     0x4c7
 863: #define XK_kana_NE                                     0x4c8
 864: #define XK_kana_NO                                     0x4c9
 865: #define XK_kana_HA                                     0x4ca
 866: #define XK_kana_HI                                     0x4cb
 867: #define XK_kana_FU                                     0x4cc
this seems to be the only one you can read online..
http://wmpkamp.com/joi/SplicerDocs/l...ysymdef.h.html

Last edited by cin_; 05-27-2014 at 09:42 PM. Reason: gramm`err
 
  


Reply

Tags
keyboard, layout, utf-8, 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to input non-utf characters from utf-8 linux enviroment? jadas Linux - General 6 02-07-2009 03:20 PM
Converting UTF-16 files to another encoding (such as UTF-8) crisostomo_enrico Solaris / OpenSolaris 3 03-25-2008 05:30 PM
im getting UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1' jabka Linux - Newbie 2 11-24-2006 05:44 AM
[Enter] in text documents diffrent on Windows and Linux? UTF-8/UTF-16 problem or? brynjarh Linux - General 1 11-24-2004 05:20 AM
X11 / UTF-8 locale seems missing 'fr_FR.UTF-8' chrsitophermann Debian 11 07-17-2004 02:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:16 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
Open Source Consulting | Domain Registration