This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to create custom keyboard layout?

Tags: None
(comma "," separated)
Thilina
Registered Member
Posts
3
Karma
0
How to create custom keyboard layout for kde plasma keybord?
I am using plasma 5.20.13
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

Can you provide more details? What exactly do you need? A real custom keyboard layout is some work, but it's worth it. For a keyboard layout only in a graphical environment, have a look at /usr/{local/}share/X11/xkb/symbols/. There are a lot of layouts defined on which you can base on.
If you only need to change some single keys, you can use `xmodmap` and create a custom ~/.Xmodmap-file to load at login.
Thilina
Registered Member
Posts
3
Karma
0
koffeinfriedhof wrote:Hi!

Can you provide more details? What exactly do you need? A real custom keyboard layout is some work, but it's worth it. For a keyboard layout only in a graphical environment, have a look at /usr/{local/}share/X11/xkb/symbols/. There are a lot of layouts defined on which you can base on.
If you only need to change some single keys, you can use `xmodmap` and create a custom ~/.Xmodmap-file to load at login.


Yes, I need for only graphical environment (in case plasma)
KDE Plasma doesn't have sinhala-wijesekara keyboard layout which has mentioned here https://forum.kde.org/viewtopic.php?f=17&t=140927.
This layout has some complex unicode mappings,
Ex:
[Key U] --> ම
[Key F] ---> ⁣ෙ
[Key F][Key U] --> ⁣ම⁣ෙ (order need to be changed)

Which means when I press [Key F] then [Key U], I need to replace [Key F][Key U] by [Key U][Key F].
Is this possible ?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
This depends on the keyboard used and how it is physically wired as keys are wired in blocks (rows and columns) so that there are combinations that aren't possibe. And there will be no dead_f key or similar to check the next char entered, like it exists for e.g. ~, ^, etc.

So the easiest way in this case would to define a compose key (e.g. CapsLock) and assign the wanted shortcuts to it. There is a detailed guide at KDE Userbase: ComposeKey.
Just create a ~/.XCompose with content like
Code: Select all
<Multi_key> <u> <f>:"ම⁣ෙ"

Setting the compose key in Plasma is easy: «systemsettings → Input Devices → Keyboard → Advanced → Position of Compose Key»
Then you can press Compose, f, u to enter the content in quotation marks.
If there is a unicode sign for it, I would prefer this.
Thilina
Registered Member
Posts
3
Karma
0
koffeinfriedhof wrote:This depends on the keyboard used and how it is physically wired as keys are wired in blocks (rows and columns) so that there are combinations that aren't possibe. And there will be no dead_f key or similar to check the next char entered, like it exists for e.g. ~, ^, etc.

So the easiest way in this case would to define a compose key (e.g. CapsLock) and assign the wanted shortcuts to it. There is a detailed guide at KDE Userbase: ComposeKey.
Just create a ~/.XCompose with content like
Code: Select all
<Multi_key> <u> <f>:"ම⁣ෙ"

Setting the compose key in Plasma is easy: «systemsettings → Input Devices → Keyboard → Advanced → Position of Compose Key»
Then you can press Compose, f, u to enter the content in quotation marks.
If there is a unicode sign for it, I would prefer this.


Thank you!

What I want is to add a new keyboard layout in, <system settings / hardware / input devices / keyboard / layouts> under the Sinhala language. Currently It only has phonetic layout which is not the standard layout for sinhala.
All the primary key mapping of Sinhala Wijesekara layout is here.
Sinhala-Wijesekara layout is available with IBus and fcitx (as m17n-db) but I need to add this for kde plasma.
How do I work with this ?

Thank you again!
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
As you need special constructs like F+U you need to switch to fcitx which catches those combinations programmatically. See https://github.com/fcitx/fcitx5-sayura for an example. There is no way to combine default keys with a standard layout like the us one as there must be definitions for those keys (like the dead_key-stuff).
Fcitx should work under Plasma too, see ArchWiki:fcitx, but as I am not able to write/read any of these languages, I do not know it by sure.
Is your language completely available with unicode signs? Then one could perhaps map something, including default compose stuff for combinations.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]