Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I used Gnome for a long time, but preferred vanilla X input method (xim) over the default GTK behaviour. I just set GTK_IM_MODULE and QT_IM_MODULE enviroment variables to xim, and didn't have any problem with multiple-layout config, Compose key, custom ~/.XCompose and misc:typo typography extensions.

Recent Gnome 3.6 completely screwed keyboard input by shipping a half-baked and buggy ibus and forcing it upon the users. I just couldn't get the keyboard working as well as before (even with ibus disabled), and had to abandon Gnome completely.

Now I use a simple window manager, and configure my keyboard with setxkbmap. While the keyboard works well again, I couldn't get get Compose key working everywhere. Compose works in plain X11 apps (xterm), but it doesn't work in neither GTK2, nor GTK3, nor Qt apps.

I use current Archlinux versions:

xorg-xinput 1.6.0
xorg-server 1.13.1
xf86-input-keyboard 1.6.2
gtk2 2.24.14
gtk3 3.6.4
qt 4.8.4

and enable Compose key like this:

setxkbmap ... -option 'compose:menu'

and export GTK_IM_MODULE, QT_IM_MODULE variables:

$ echo $GTK_IM_MODULE $QT_IM_MODULE 
xim xim

Compose key is propoperly recognized by X11:

$ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
135 Multi_key

It works properly in xterm, sequences from my ~/.XCompose included. It doesn't work in neither GTK nor Qt apps. Let say, if I enter Compose ', then apps echo ' immediately, without waiting for the third key in the sequence.

Now I suppose something has changed in either Xorg (because Compose doesn't work in Qt apps either), or in GTK and Qt. *_IM_MODULE variables are not enough now. What else is required to make modern GTK and Qt recognise xim and its Compose sequences?

P.S. There is a similar (and unanswered) question about Compose key not working in GTK. Unlike the asker, I don't have ibus installed.

share|improve this question

3 Answers 3

I had a similar problem in openSUSE. ~/.XCompose would be ignored by GTK+ applications, so my own Compose sequences did not work in Firefox, Gimp, and others.

I found out that gtk-query-immodules-2.0 listed a few input methods, but not xim; so, irrespective of the GTK_IM_MODULE variable, xim was unavailable. Installing the packages gtk2-immodule-xim (and friends) solved the problem.

Maybe this remark proves useful for people suffering from the same curse.

share|improve this answer
up vote 3 down vote accepted

Found a solution which works for GTK apps (but not Qt). One needs to set

XMODIFIERS="@im=none"

to let X11 handle dead keys. Thanks to @PabloSaratxaga for his answer.

share|improve this answer

This is a way of persistent configuration. It is described for example here https://wiki.edubuntu.org/ComposeKey#line-66 . I configured compose keys with ~/.XCompose this way. I have checked this both on ubuntu and debian systems.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.2.26.2347\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. <br>This site is not affiliated with Linus Torvalds or The Open Group in an"], "copyright__copyright__copyright": ["aga for his answer.\n\nshare|improve this answer\n\nThis is a way of persistent configuration. It is described for example here https://wiki.edubuntu.org/ComposeKey#line-66 . I configured compose keys with ~/.XCompose this way. I have checked this both on ubuntu and debian systems.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}