You are not logged in.

#1 2026-06-04 04:42:36

thesupertechie
Member
Registered: 2026-03-07
Posts: 34

XKB questions

Hi!

I read #312518 again, and realized that it might benefit people to add the Tamil 99 layout to XKB (it's unrelated to the TamilNet '99 layout already in XKB which appears to be for typewriters).

To understand why this is hard to implement, I need to explain:

The way Tamil 99 works is, by pressing a consonant, say த, then a vowel, say ஆ, it will combine into தா. If you only type ஆ, it will do ஆ.

So you might think, just create the layout in XKB! But it's not that simple, unfortunately. The way Unicode implemented most Indian languages is that they have separate vowel combining characters and vowel independent characters, as they use abugidas. So if you were to use this "layout", you'd get தஆ, which is wrong. Tamil 99 handles this automatically.

I'm aware that the layout is already in m17n, but I wanted to add it to XKB as I've had less than ideal experiences with IMEs.

So I've considered a few things to add the vowel blending:
* User XCompose files (which would be great for me, but I'd like it to work for everyone else as much as me to be as accessible as possible)
* Compose locales (but this would require everyone to switch their locale to Indian Tamil; you don't need to switch locales to use a German layout, and I don't think you should need to here as well)
* some sort of "hybrid dead key" (which would be great, but the vowel blending isn't a dead key, and adding this would require users to push keys twice; also, this doesn't appear to currently be in XKB).

Some advice would be appreciated!


Hardware:
HP Envy Laptop 16-h1055cl (32 GB RAM, Intel Core i7-13700H, NVIDIA GeForce RTX 4060 Laptop GPU)

Offline

#2 2026-06-04 06:48:24

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

Let unicode handle the joining of characters. Combining characters works flawlessly. I have created a phonetic layout for Gujarati (guj-kagapa), which in now available in official xkeyboard-config package.

EDIT: All possible unicode characters that can be mapped to a key are here. As per your example you can map ா   to A and ஆ to AltGr+A or something like that.

You can just create a keymap and put it in /usr/share/X11/xkb/symbols/custom . To start take any existing keymap from /usr/share/X11/xkb/symbols/ as a guide and do some test with joining. One thing to note is you cannot directly put joined characters on a single key unless they are defined in unicode map. All the best.

Note: keyboard can be switched using "setxkbmap custom tamil-99" or something like that. This command can be bound to any preferred shortcut to switching languages on the fly.

Last edited by Docbroke (2026-06-04 07:17:33)

Offline

#3 2026-06-04 07:09:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

Combining characters works flawlessly.

already in m17n, but I wanted to add it to XKB as I've had less than ideal experiences with IMEs

Afaiu the premise is that it does not?

Note: keyboard can be switched using "setxkbmap custom tamil-99" or something like that. This command can be bound to any preferred shortcut to switching languages on the fly.

Avoid doing that and prefer a group switch, https://wiki.archlinux.org/title/Xorg/K … rd_layouts
setxkbmap is slow AF and will reset the state.

@thesupertechie

The composition happens by some IME, in doubt XIM - NOT the xkb layout. The latter defines what keys are, not how key sequences are handled.
So unless you're willing to map the desired characters onto higher layers (and then use eg. altgr for the 3rd and shift+altgr for the 4th layer) what is then not tamil99 but offers the glyphs by different means,  you'll have to use an xcompose definition or extended IME (m17n)
=> What are you exact problems w/  m17n and using which IME? Gnome forcing ibus upon you?

~/.XCompose will override any other compose definition and you can include there whatever you want - regardless of the overall locale.
So you can have ~/.XCompose starting w/

include "/usr/share/X11/locale/en_US.UTF-8/Compose"

and then

include "/usr/local/share/X11/tamil/Compose"

to augment that etc et pp.

Offline

#4 2026-06-04 07:31:29

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

What I want to say by combining characters is, for e.g., in guj-kagapa
ો is on "o"
ક is on k
when typing ko it becomes કો not ક ો or
k+f+x = ક્ષ not ક ્ ષ

All this works, as all this joinings are already standard in unicode.

EDIT: problem with switching layout using group switch is that it works when you only need to switch between 2, otherwise it becomes confusing. Also for testing layouts/ temporary layouts setxkbmap is easier as you don't have to change any config files.

Last edited by Docbroke (2026-06-04 07:52:48)

Offline

#5 2026-06-04 08:04:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

All this works

Yes, courtesy of your https://wiki.archlinux.org/title/Input_method - eg. gtk will just default to ibus. That doesn't mean you've to be using m17n but these things also don't happen just automagically.

works when you only need to switch between 2, otherwise it becomes confusing

How so?
Does https://bbs.archlinux.org/viewtopic.php … 5#p2209185 help you?

Offline

#6 2026-06-04 08:38:26

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

I am not having any of this ibus/fcitx/scim etc. installed.

─▶ echo $GTK_IM_MODULE
simple

This character joining also works with QT (telegram-desktop) where QT_IM_MODULE is empty. 

How so?

I prefer to have keybinds like, win+g --> Gujarati, win+escape --> English, win+h --> Hindi, this had worked better for me compared to using same keybind to rotate among this.
Note: after switching to labwc (wayland) I am actually using group switch (shift+caps) as setxkbmap no longer works reliably, but given option I would prefer that. I suggested setxkbmap to OP because I think it is more suitable for testing purpose. For routine use group switch can work.

Offline

#7 2026-06-04 15:34:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

after switching to labwc (wayland)

All X11 stuff becomes irrelevant - setxkbmap would only impact xwayland. You *have* to use whatever labwc/wlr offer to control the layout.

When copy-pasting ક and ો into some input, does that become કો ?
When entering "ક  ો" and then deleting the central blank, does that become કો?
Does entering કો work in eg. st or foot or xterm?

Offline

#8 2026-06-04 16:04:31

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

You *have* to use whatever labwc/wlr offer to control the layout.

Yes, Indeed. I am left with only environment file provided by labwc to select XKB layouts and choose a toggle key.


When copy-pasting ક and ો into some input, does that become કો ?

No, they remain ક ો


When entering "ક  ો" and then deleting the central blank, does that become કો?

No it deletes  ો
EDIT: above happens in firefox, libreoffice but in foot it actually deletes blank space only to give કો


Does entering કો work in eg. st or foot or xterm?

Works in foot.

Last edited by Docbroke (2026-06-05 04:08:50)

Offline

#9 2026-06-04 19:15:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

What about some xwayland terminal (st or xterm)?
I wonder whether the behavior is just driven by the wlr/wayland IME

Offline

#10 2026-06-05 04:00:42

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

It is same everywhere (X/wayland/xwayland/gtk/qt, I have used similar configuration with cwm+lxterminal, without any installed IME.

When entering "ક  ો" and then deleting the central blank, does that become કો?

No it deletes  ો

EDIT: above happens in firefox, libreoffice but in foot it actually deletes blank space only to give કો

Video: https://youtu.be/0tofPHGZDfE

Last edited by Docbroke (2026-06-05 14:32:24)

Offline

#11 2026-06-05 18:12:50

thesupertechie
Member
Registered: 2026-03-07
Posts: 34

Re: XKB questions

=> What are you exact problems w/  m17n and using which IME? Gnome forcing ibus upon you?

No, no gnome in sight smile

I've not ever had the best experiences with either Fcitx5 or IBus. IBus, I believe didn't work last time I tried it (I think it crashed whenever it launched?) and Fcitx5 has this random issue where it'll jumble the keys around to my dvorak layout (I got help from the developer last time, and when migrating I used the exact same settings, but alas, it's now even more broken). I'll give iBus another try though, my last experience with it was a while ago.


Hardware:
HP Envy Laptop 16-h1055cl (32 GB RAM, Intel Core i7-13700H, NVIDIA GeForce RTX 4060 Laptop GPU)

Offline

#12 2026-06-05 18:24:02

thesupertechie
Member
Registered: 2026-03-07
Posts: 34

Re: XKB questions

IBus is...surprisingly working well.

The only problem is that the keyboard shortcuts are in their QWERTY position when I use Tamil99 (I had to use the "Use US keyboard layout" option for the keys to not be jumbled, but now the shortcuts aren't in the right place). Any idea how to fix that?

Last edited by thesupertechie (2026-06-06 02:30:13)


Hardware:
HP Envy Laptop 16-h1055cl (32 GB RAM, Intel Core i7-13700H, NVIDIA GeForce RTX 4060 Laptop GPU)

Offline

#13 2026-06-06 18:16:35

thesupertechie
Member
Registered: 2026-03-07
Posts: 34

Re: XKB questions

So...is there no workaround for this on Ibus?


Hardware:
HP Envy Laptop 16-h1055cl (32 GB RAM, Intel Core i7-13700H, NVIDIA GeForce RTX 4060 Laptop GPU)

Offline

#14 2026-06-06 18:20:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

I'm not even sure what the problem is

setxkbmap -print -query

What layout do you expect and how are the keys "jumbled"?
How and when do you set the layout and how and when do you start ibus?

Docbroke's situation doesn't work for you?

Offline

#15 2026-06-06 22:51:35

thesupertechie
Member
Registered: 2026-03-07
Posts: 34

Re: XKB questions

M17n maps the layout to QWERTY positions. If I don't enable "Use US keyboard position" then the layout key locations are in the wrong position. Take the photo of Tamil 99 I shared in the first post. Do you see இ? இ is mapped to QWERTY S. If I don't enable the setting, it gets mapped to Dvorak S, which is where ந should be. Because if I enable the setting, the keyboard shortcuts assume the QWERTY positions. I was asking whether I could fix that.

I'm confused about Doc's solution. Are they not using an IME, so does the layout automatically place the independent vowel when at the beginning of the word?

Curiosity questions: 1) does XKB have the ability to map multiple keys? Then I could make QWERTY h+q change into கா. 2) Can XKB map one key to multiple characters? ஶ்ரீ, a Tamil character, is implemented as a font ligature of ஶ் and ரீ. 3) If I add compose combinations to a Compose locale to port Tamil 99, i.e. tscii-0 for Tamil, then do I need to switch my system locale to Indian Tamil to use Tamil 99? Or does it need to be in the list of available ones?

Last edited by thesupertechie (2026-06-06 23:46:49)


Hardware:
HP Envy Laptop 16-h1055cl (32 GB RAM, Intel Core i7-13700H, NVIDIA GeForce RTX 4060 Laptop GPU)

Offline

#16 2026-06-07 03:28:41

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: XKB questions

Are they not using an IME, so does the layout automatically place the independent vowel when at the beginning of the word?

1) does XKB have the ability to map multiple keys? Then I could make QWERTY h+q change into கா.

No you cannot map "h+q" but you can map h to something and q to something. Have க on h and  ா   on q, it will become கா on pressing h+q. In case you need other characters on Q (independent vowels) you can map them on other layers ( Shift+Q, AltGR+Q, AltGR+SHIFT+Q ), so it is possible to have 4 characters on single key. So when you need dependent vowel on Q as joined character press Q, and when you want it independent press Shift+Q or something like that.

2) Can XKB map one key to multiple characters? ஶ்ரீ, a Tamil character, is implemented as a font ligature of ஶ் and ரீ.

No. You can't have multiple characters printed by pressing single key. As far as I know this type of joined characters are not in unicode character map. You will have to type individual characters. However they can be combined using some special keys, like " ્" and ZWNJ and ZWJ

3) If I add compose combinations to a Compose locale to port Tamil 99, i.e. tscii-0 for Tamil, then do I need to switch my system locale to Indian Tamil to use Tamil 99? Or does it need to be in the list of available ones?

I haven't done this so actually cannot answer, but you can try it yourself by adding one or two compose combinations. However I feel that if you can include all characters defined by unicode in your keymap, you can have much better keymap compared to existing tamilnet in xkb ( it uses only two layers, key and shift+key, and for many keys shift+key layer is absent). You can copy existing tamilnet layout to custom file and add additional AltGr, and AltGr+Shift layers to make it more intuitive.

M17n maps the layout to QWERTY positions. If I don't enable "Use US keyboard position" then the layout key locations are in the wrong position. Take the photo of Tamil 99 I shared in the first post. Do you see இ? இ is mapped to QWERTY S. If I don't enable the setting, it gets mapped to Dvorak S, which is where ந should be. Because if I enable the setting, the keyboard shortcuts assume the QWERTY positions. I was asking whether I could fix that.

You can define you shortcuts at lower level (keycodes instead of keysyms, so that changing keymap doesn't change it.

Offline

#17 2026-06-07 06:33:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,841

Re: XKB questions

You can define you shortcuts at lower level (keycodes instead of keysyms, so that changing keymap doesn't change it.

The developer can but the user usually not - that's why I asked about the order of the keyboard/layout setup and the setxkbmap output.

Take the photo of Tamil 99 I shared in the first post.

That's a QWERTY keyboard.

it gets mapped to Dvorak S

So the conflict is that you're trying to use a DVORAK layout for latin and QWERTY for tamil (ie. hitting the second key in the second row of the alphabetic block shall give you either இ or O?
Do you somehow switch layouts to alter between latin and tamil input or do you use the 3rd level shift (altgr) to enter tamil?

Offline

Board footer

Powered by FluxBB