In the /usr/share/X11/xkb/symbols directory there are various keyboard layouts listed. I made a copy of the /usr/share/X11/xkb/symbols/us file under the name /usr/share/X11/xkb/symbols/new_test_layout.

The symbols corresponding to the keys being pressed are indicated in the file as in the given example:

xkb_symbols "basic"{
//other keys
key <AD01> {[q, Q]};
//other keys

This means that the symbol lowercase q appears when the key AD01 is pressed normally, and uppercase Q appears when the key AD01 is pressed along with shift key. From my understanding, the third symbol listed will appear when the key is pressed along with alt-gr key, and the fourth symbol when it is pressed along with alt-gr and shift both.

I can replace the symbols provided under each key with a symbol of my choice. However, in this file the symbols are not being directly represented as string characters or by their Unicode values. For example in the file there is

key <AB10> {[slash, question]};

I am very new to Linux, so I am not sure what these are, but I am guessing that they are variables defined in another file. Anyhow slash will correspond to the symbol / and question will correspond to the symbol ?

In this webpage, there is an example of an xkb layout for a Farsi keyboard.


Here you can see for example,

key <AD10> {[Arabic_hah, bracketleft, 0x100202c]};

So the key AD10 (which is the P key in a regular QWERTY keyboard) should give the character ه which is listed as U0647 (ARABIC LETTER HEH) under Unicode. The letter is being referred to as Arabic_hah. Where do I find a listing of these names? If I were to simply use U0647 in its place, would it still be recognised in any file within the xkb directory? In Urdu there is a letter choti he, ہ that looks similar to the Arabic heh, but has a different Unicode listing: U06C1 (ARABIC LETTER HEH GOAL). I do not know the name that is being used for choti he in Linux because I cannot find the Urdu keyboard layout anywhere in the /usr/share/X11/xkb/symbols directory, even though the files for Dari (af) and Arabic (ara) are present.

Will it be sufficient if I were to simply use the Unicode values for all symbols that are supported by Linux in any file within the xkb directory?


1 Answer 1


The keyboards are (mostly) not according to language but by country. Urdu keyboards are in /usr/share/X11/xkb/symbols/pk (Pakistan) and /usr/share/X11/xkb/symbols/in (India). And there they used unicode hex.

  • In general, if I use any Unicode hex symbol will it be recognised in any file within the /xkb/symbols directory? Where are these names like Arabic_hah for ه defined?
    – sriganesh
    Commented Sep 25, 2021 at 12:57
  • Yes, you can use unicode hex in pattern UXXXX or 0x100XXXX . Symbols like Arabic_hah are declared in /usr/include/X11/keysymdef.h as mentioned in unix.stackexchange.com/questions/101410 Commented Sep 25, 2021 at 13:20
  • Okay, thank you. I found the listings of the names of the Urdu-specific characters being mapped to their Unicode values in the keysymdef.h file, including the Urdu numeral symbols (Arabic-Indic digits) which are otherwise absent from my regular Urdu Phonetic keyboard.
    – sriganesh
    Commented Sep 25, 2021 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .