Bug 828 - GTK+ on mac has poor keymap support and no IME support
Summary: GTK+ on mac has poor keymap support and no IME support
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
: 148 827 3551 4175 6165 8275 11368 ()
Depends on:
Reported: 2011-09-15 06:28 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-06-20 17:23 UTC (History)
13 users (show)

Tags: gtk
Is this bug a regression?: ---
Last known good build:

Keymap that causes trouble (10.80 KB, application/octet-stream)
2011-09-15 10:34 UTC, Rodrigo Kumpera

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mikayla Hutchinson [MSFT] 2011-09-15 06:28:51 UTC
GTK+ on mac has poor keymap support, and not IME support. This means that users cannot enter text with extended and non-Latin character sets, and may have trouble entering English text with non-English keyboards.
Comment 1 Mikayla Hutchinson [MSFT] 2011-09-15 06:29:58 UTC
This has been a known issue for some time, but I'm creating this bug to track it and enable aggregating duplicate report.
Comment 2 Mikayla Hutchinson [MSFT] 2011-09-15 06:30:18 UTC
*** Bug 827 has been marked as a duplicate of this bug. ***
Comment 3 Mikayla Hutchinson [MSFT] 2011-09-15 06:30:53 UTC
*** Bug 148 has been marked as a duplicate of this bug. ***
Comment 4 Rodrigo Kumpera 2011-09-15 08:40:21 UTC
Since this bug is been used to aggregate all duplicates, it's worth posting here the known workaround.

Go to Settings -> Language & Text -> Input Sources.

Enable "Allow a different one for each document".
Enable "Show Input menu in menu bar".

Select the "U.S." input source in addition to the one you already had.

Now, when using MD, switch to "U.S." in the input source method. Here it's the first one on the left of the clock.

I'm using OSX Lion and support for per-app input source is buggy so more often than not it switches MD back to my default keymap. Which is annoying but there's probably nothing that can be done.

BTW, if the per-app input source issue I'm having is actually a gtk+ bug and it's much easier to fix than the whole keymap thing, it might make sense to only fix it.
Comment 5 Michael Natterer 2011-09-15 09:14:48 UTC
So you can still reproduce the issue on a current MD build? Can you
give me exact instructions? I don't quite follow the instructions
in bug #148.
Comment 6 Rodrigo Kumpera 2011-09-15 10:17:15 UTC
Here's my setup:

Mono 2.10.5: http://www.go-mono.com/mono-downloads/download.html
MonoDevelop 2.8 alpha 2: http://monodevelop.com/Download

I'm using a custom keymap "U.S. International - PC".

To reproduce it I open a project on MD and go to the C# editor and try to type ". If switch the layout back to the default one it works.

I'm on OSX Lion if that makes a difference, but I believe the issue to be present on Snow Leopard as well.
Comment 7 Rodrigo Kumpera 2011-09-15 10:34:06 UTC
Created attachment 379 [details]
Keymap that causes trouble

This keymap only changes how one types characters like ç é á à and ã. Others such ; : " ' remains the same as the U.S. layout.
Comment 8 Mikayla Hutchinson [MSFT] 2011-09-27 10:21:32 UTC
There is a separate bug for layout switching, bug 958.
Comment 9 Michael Natterer 2011-09-27 10:55:02 UTC
Rodrigo, with that keymap, what is impossible to type? I seem to be
able to enter anything (virtual keyboard open to check what i'm doing),
apart from using ~ as dead key, which is apparently a bug. My guess is
that they are simply missing from the hardcoded table of dead keys.

But other than that, all seems fine.

I'm on GTK+ master with all recent patches included (so a master without
any patches, as of Sept. 27th).
Comment 10 Jeffrey Stedfast 2012-02-23 15:15:25 UTC
*** Bug 3551 has been marked as a duplicate of this bug. ***
Comment 11 Mikayla Hutchinson [MSFT] 2012-04-02 16:52:15 UTC
*** Bug 4175 has been marked as a duplicate of this bug. ***
Comment 12 Mikayla Hutchinson [MSFT] 2012-07-18 19:56:09 UTC
*** Bug 6165 has been marked as a duplicate of this bug. ***
Comment 13 Ruda 2012-07-26 15:30:09 UTC
Will you make a year and problem persists.
This is ridiculous.
Comment 14 Paul Johnson 2012-09-25 09:56:35 UTC
¦ is incorrectly mapped for UK keyboards. Makes saying 

if (foo == bar ¦¦ wibble == wobble)

a bit of a pain!
Comment 16 Michael Natterer 2012-10-11 05:42:57 UTC
On latest GTK+ hitting shift+\ on any US-ish keyboard gives
me | without problems. What version of MD are you on?
Comment 17 Paul Johnson 2012-10-11 07:13:44 UTC
I'm for Mac. Using Mountain lion
Comment 18 Mikayla Hutchinson [MSFT] 2012-10-11 17:13:53 UTC
Paul, what UK keyboard layout? Apple or PC? And your example isn't valid C#, are you sure you don't mean '|' rather than '¦'?
Comment 19 Paul Johnson 2012-10-11 17:55:46 UTC
Using a standard PC keyboard with the settings as British-PC.

When I try for |, I get ¦
Comment 20 Michael Natterer 2012-10-12 04:59:40 UTC
I get exactly the same in GTK+ and in native apps:

Shift+\ - > ¦
Option+` -> |

Really tried Briish-PC this time ;)

I don't have a standard PC keyboard to try tho, only the apple one.
Comment 21 Paul Johnson 2012-10-12 06:21:05 UTC
ALT + backslash == |

Hmm, might need to invest in an apple keyboard - I just hate them!
Comment 22 Mikayla Hutchinson [MSFT] 2012-11-09 14:57:46 UTC
*** Bug 8275 has been marked as a duplicate of this bug. ***
Comment 25 Mikayla Hutchinson [MSFT] 2013-03-25 17:34:28 UTC
*** Bug 11368 has been marked as a duplicate of this bug. ***
Comment 27 Mikayla Hutchinson [MSFT] 2013-06-19 14:59:54 UTC
GTK now has a Cooca IME built in, and there's also gtkimcocoa. Not sure which is better.

Mitch, any thoughts on the following patches?

https://bugzilla.gnome.org/show_bug.cgi?id=698183 https://github.com/ashie/gtkimcocoa/blob/master/patches/translate-JIS-Hiragana-Eisu-keys.patch
Comment 28 Michael Natterer 2013-06-19 15:20:15 UTC
Reviewing these and recommending something to you guys is on my agenda
this week anyway :)
Comment 29 Michael Natterer 2013-06-20 04:46:20 UTC
Actually, I meant to review the new Cocoa IME code in GTK+, I haven't
had the chance to look at that yet, but the bug you linked was also
on the agenda. I commented upstream, the approach sounds very sane to
me, i never liked the "maybe" part in maybe_update_keymap(), it always
felt like a huge hack.
Comment 30 Michael Natterer 2013-06-20 11:33:40 UTC
I have tested, cleaned up and pushed the patches in

Also, I did the proposed change to not check for a keymap change
in update_keymap() any longer, because the function is now only
called on actual keymap changes.
Comment 31 Mikayla Hutchinson [MSFT] 2013-06-20 14:12:21 UTC
Landed in bockbuild. I think we can close this bug for now, if anything crops up we'll open more specific issues :)
Comment 32 Michael Natterer 2013-06-20 17:23:04 UTC
I'll test and review the actual IME patches that landed in upstream anyway,
they sneaked when I was otherwise occupied.