13

The problem is that the compose key works fine, but some application doesn't accept some characters from it. E.g. I can type the character in Emacs (Compose+8+8), but this won't work in FireFox, Konsole and Kate. But many other characters, e.g. typed there (in FireFox, Konsole and Kate) with Compose work just fine. Also I may insert a problem symbols with a simple copy-paste (from any of two clipboards).

So, what could cause it, and how to fix it?

Sorry, but I have no idea how to research the issue. I found people whose Compose key didn't worked at all in some apps, but in my case it is works, though somehow partially.

Setup: the compose key bound to the right Super key in both /etc/default/keyboard and KDE keyboard settings.

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
Hi-Angel
  • 4,778
  • 4
  • 28
  • 45
  • 1
    Usually it's because different toolkits (Athena, Motif, Gtk, KDE, …) use different input methods. What does `env | grep IM` show? Do you have an input method configured anywhere? – Gilles 'SO- stop being evil' Nov 09 '14 at 09:20
  • @Gilles [here it is](http://pastebin.com/vfjh8SqC). – Hi-Angel Nov 09 '14 at 09:23
  • @Gilles I didn't knew about a different input methods… So, do I have to install ibus to fix it? Also I am wondering wouldn't it conflict with KDE keyboard settings? As I remember, the ibus have its own settings too. – Hi-Angel Nov 09 '14 at 09:26
  • @Gilles well, I remember I tried ibus, and it seemed to me raw. I couldn't find how to stop the daemon *(it isn't present in `/etc/init.d/` and in list of KDE's services)*, the only way I found was to purge it. Also I just installed it again, and found that it don't even have a setting to have a different layouts by a windows. Are there a way to use the native KDE input method for all applications? – Hi-Angel Nov 09 '14 at 09:46
  • I found two interesting details. The first is that even for «ibus» isn't installed, I have the package «ibus-qt4». And it have the file `ibqtim-ibus.so`, lsof of which shows that it is being used by a KDE apps. The second appeared from [this question](http://askubuntu.com/questions/300345/compose-key-combinations-are-wrong-in-kde-qt-apps): for I press «Compose+a+_», it gives the `ā` in Emacs, and the `ª` FireFox, and etc. I guess I have to try to remove this package, and see does it fix the problem. – Hi-Angel Nov 09 '14 at 10:48
  • Hmmm… I found even two packages with ibus-qt in the name, and purged the both. Now I restarted X, but the problem is still present. – Hi-Angel Nov 09 '14 at 10:56
  • That's just crazy! I added to my `.xsession` the three lines `export GTK_IM_MODULE=xim export XMODIFIERS=@im=xim export QT_IM_MODULE=xim`, restarted X, and now Compose key refused to work at all in FireFox and Konsole!But it is still works in Emacs and Chrome! I'm out of ideas – Hi-Angel Nov 09 '14 at 11:06

1 Answers1

9

Thanks to @Gilles, I found an answer. So, the problem was with different Input Methods, used by different applications; and IMs in turn use different Compose files — ones used by X are /usr/share/X11/locale/<your-locale>/Compose and ~/.XCompose (the last isn't present by default, but you may create it for custom combinations), and the one used by Qt is in… Well, looks like nobody knows.

The solution is to set xim to be used as default input method by all applications. You can call im-config, and choose there xim as the default input method, or you can manually edit /etc/profile file to add these lines:

export GTK_IM_MODULE=xim
export XMODIFIERS=@im=xim
export QT_IM_MODULE=xim

Not sure about im-config, but for the way with /etc/profile reboot will be needed.

Hi-Angel
  • 4,778
  • 4
  • 28
  • 45
  • Also I found that `im-config` in some cases instead of saving a new configuration falls with a GTK error. I guess this a feature because for this case the application have a flag `-c` → it launches a terminal UI – Hi-Angel Dec 02 '14 at 10:58
  • I have fixed your grammar, as the answer was had to read. Can you check that I have not changed the intended meaning. – ctrl-alt-delor Aug 12 '19 at 14:51
  • note `im-config` is in package `im-config` and not installed by default on debian. so do `apt install im-config` – ctrl-alt-delor Aug 12 '19 at 14:53
  • @ctrl-alt-delor oh, thanks, when I wrote this answer I was very bad at english. I'll edit it in a sec though, because there's a typo *(simpley)*, and also "didn't programmed with GUI" quite the opposite of "not a programmer" :) But thank you anyway! – Hi-Angel Aug 12 '19 at 14:55
  • FWIW, if i set those options, the compose key stops working entirely. That's on Fedora 32 with Cinnamon. – Tom Anderson Jun 07 '20 at 22:22
  • 1
    @TomAnderson I'm on Manjaro. When I tried to follow exactly these steps, it also happened to me that the compose key stopped working (I'm testing on firefox). Then, following this: https://wiki.archlinux.org/index.php/Fcitx#XIM and messing around a bit, I found out that adding `export GTK_IM_MODULE DEFAULT=xim` and `export QT_IM_MODULE DEFAULT=xim` to both `/etc/profile` and `/etc/X11/xinit/xinitrc/` did the job. – izzorts Sep 14 '20 at 20:57