How to type unicode characters in KDE?

32

11

This answer has tips on how to do it on Gnome or Vim, but these don't work on KDE. This bug shows that KDE don't support the ISO notation with Ctrl+Shift plus the character's hex code. Is there any other way I can do this with a keyboard (that is, without copying and pasting)?

Helder S Ribeiro

Posted 2009-11-24T14:25:30.427

Reputation: 5 997

Answers

23

Memorising hexcodes is madness. Use the compose key instead. It lets you combine characters in a mnemonic way. This is a feature of X, not just KDE, thus works everywhere. Some examples:

  • Compose, v, C   →   Č
  • Compose, ´, E   →   É
  • Compose, _, u   →   ū
  • Compose, ^, i   →   î
  • Compose, ,, S   →   Ş
  • Compose, +, o   →   ơ
  • Compose, ;, a   →   ą
  • Compose, U, g   →   ğ
  • Compose, ", u   →   ü
  • Compose, °, A   →   Å
  • Compose, ~, N   →   Ñ
  • Compose, +, -   →   ±
  • Compose, ., >   →   ›
  • Compose, ., .   →   …
  • Compose, ., =   →   •
  • Compose, P, !   →   ¶
  • Compose, !, ^   →   ¦
  • Compose, !, !   →   ¡
  • Compose, ?, ?   →   ¿
  • Compose, s, s   →   ß
  • Compose, o, e   →   œ
  • Compose, O, E   →   Œ
  • Compose, a, e   →   æ
  • Compose, A, E   →   Æ

Each key is typed sequentially without holding down. See the file /usr/share/X11/locale/en_US.UTF-8/Compose (online, 124 KiB) for the whole list. You can define your own compose sequences in your ~/.XCompose file (example).

Since I do not have a Sun keyboard, I do not have a physical Compose key. I remap the useless Caps Lock key as logical Compose key. Change this in System Settings → Region/Language → Keyboard Layout (kxkb applet) → tab Advanced → section Compose key position, or run the command setxkbmap -option compose:caps.

daxim

Posted 2009-11-24T14:25:30.427

Reputation: 1 072

+1 "Memorising hexcodes is madness." → Couldn't agree more, but I'm surprised that my compose file doesn't contain some useful characters, like ✓ (u2713). The GitHub you linked to is supremely useful. – Mark E. Haase – 2014-08-18T16:53:52.690

2@daxim and if I need to enter ascii control characters? – user2284570 – 2015-08-20T18:24:22.537

Add them to /usr/include/X11/keysymdef.h in the #ifdef XK_LATIN1 section and recompile X. You should now be able to type them via Compose key. – daxim – 2015-08-23T19:00:48.137

1Using the compose key is indeed helpful. But this answer does not answer the original question. AFAIK there's no method in KDE at the moment that would allow inserting any Unicode character using it's code. E.g. how would you type U+2620, i.e. ☠? The only way is to add a custom key combo, which is not ideal. – teekarna – 2018-07-24T07:31:31.710

Sometimes one has to "unask" the question. /// kragen xcompose contains ☠, it is made usable by the system by copying a file, it can't get easier than that. – daxim – 2018-07-24T09:33:59.737

2Compose is not a solution. The number of possible characters that I would like to type from the unicode exceeds what is mappable with compose in a mnemonic way. Memorizing non-mnemonic compositions is equal madness. And there's characters like RTL, LTR, RTL-override, Variant selection, Unicode flags, all those various emojis, and so forth - I'm fine with memorizing hex codes, and sometimes I haven't memorized a hex code, but look it up and just want that to type that character by hex code. Compose is not an answer, and unasking this question is not helpful but ignorant! – Christian Hujer – 2018-10-30T07:01:50.440

Besides, messing around with compose or even recompiling X is NOT a viable solution for a lot of users! – Christian Hujer – 2018-10-30T07:02:49.390

Christian, your assessment is wrong. It only makes sense if one ignores the existence of character map applications. Also, copying a file into the home directory is always a viable solution for any user.

– daxim – 2018-10-30T19:39:16.063

I disagree that memorizing arbitrary combinations with mnemonics that are specific to Xorg is better than memorizing arbitrary combinations without mnemonics that are universal. – Carolus – 2019-05-18T07:35:45.913

10

Here is the KDE bug on the issue: https://bugs.kde.org/show_bug.cgi?id=103788

I addressed this issue in an article that deals with typing RTL text. Although in most common desktop environments Unicode symbols can be typed by holding the Alt key and pressing the numeric keypad plus sign then the Unicode value in hex, KDE users cannot use this method as KDE relegates responsibility for implementing this feature to Xorg, and Xorg relegates to Qt, and Qt relegates back to Xorg.

dotancohen

Posted 2009-11-24T14:25:30.427

Reputation: 9 798

3

Have a look at this article: Unicode Easy Keyboard Layout for XKB

ricbax

Posted 2009-11-24T14:25:30.427

Reputation: 4 894

-1

Reading the bug data its said GTK2+ windows still allow this resource to be used and I can confirm that using something like "gedit" allowed to use again unicode chars on KDE plasma.

I know this is an old thread but it seems no one mentioned this earlier so decided to leave here my very first update on superuser.

It's not ideal but it helps a ton .. I use both unicode and also the compose key (mapped to my right alt key) but I definitely prefer unicode as it has a huge amount of chars available and easy to use (IMO).

rodhash

Posted 2009-11-24T14:25:30.427

Reputation: 1