I’d like to use UTF8 math symbols, when typing one list, another list.
I’ve found something called ComposeKey. Unfortunately it’s not covering omega, theta, right arrow etc.
I am using KDE, I’ve tried global shortcuts, but does not seem to work.
How to setup typing utf8 symbols (like: Θ, Ω,∃, ∀,⇒,→) with keyboard combinations (like Meta+S) ?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You can define your own table for the Compose key: create a file called .XCompose in your home directory. You’ll need to define the whole table (you can’t just add your definitions to the system default, you have to copy the system default into your file if you want it).
You’ll find the system default table in /usr/share/X11/locale/en_US.UTF-8/Compose on Debian and Ubuntu and in a similar location on other unices. The format should be reasonably straightforward; a typical definition looks like these:
<dead_acute> <a> : "á" aacute # a dead key: press Dead_acute then A to insert "á" <Multi_key> <acute> <a> : "á" aacute # Press Compose, ', A to insert "á" <Multi_key> <g> <a> : "α" U03B1 # 03B1 is the hexadecimal code of "α" <Multi_key> <M> <A> : "∀" U2200 # 2200 is the hexadecimal code of "∀" <Multi_key> <minus> <greater> : "→" U2192 <Multi_key> <bar> <minus> <greater> : "↦" U21A6
ASCII characters and a few others have symbolic names; you’ll find these names in /usr/include/X11/keysymdef.h. For example, - is minus because keysymdef.h contains the line #define XK_minus 0x002d and 2d is the hexadecimal code of -.
You can have sequences of more than two characters, like |-> in the example above. Note that if you define a compose sequence for |->, you can’t have another for |-.
If you prefer AltGr+key₁ʹ, key₂ to Compose, key₁, key₂ then you can bind AltGr+key₁ʹ to a dead key with xmodmap. It’s not necessarily a blessing, and note that you are limited to the dead key names listed in /usr/include/X11/keysymdef.h.
For characters that you don’t use often enough to remember a key sequence anyway, you can use KCharSelect (or its Gnome equivalet GUCharMap). Or do what mathematicians are used to doing, which is type in LaTeX.
Method 2
I’ve found interesting tool, for translating xorg events differently, depending on application you are using:
Here: Application-specific keymapping
App: evrouter (with new version coming: evoruter2)
According to this topic, it might be used in order to add specific mapping for math symbols only in math related apps.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0