summaryrefslogtreecommitdiff
path: root/gtk/gtkimcontextsimple.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@lanedo.com>2012-11-30 14:39:42 +0100
committerMichael Natterer <mitch@gimp.org>2012-11-30 15:09:46 +0100
commitf619f91a8fb8e01e399ab29c1f1355146d730bc4 (patch)
treea7715aeed7d0a8973cd7de9a899d95b9a55b7d59 /gtk/gtkimcontextsimple.c
parente36f80f0efbe2b302026d1bf1998a0e6eca9c37f (diff)
downloadgtk+-f619f91a8fb8e01e399ab29c1f1355146d730bc4.tar.gz
gtk: add more OSX special casing for the deadacute and deaddoubleacute keys
So " plus foo prduces foo-with-diaereses and ' plus c produces c-with-cedilla. (cherry picked from commit c0102b30894401a9a1d6d93a972bcc6c37f1b5ac)
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r--gtk/gtkimcontextsimple.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index ae88ef4d0c..1ffb42f60b 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -371,26 +371,51 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
gint n_compose)
{
GtkIMContextSimplePrivate *priv = context_simple->priv;
+ gunichar value = 0;
- if (n_compose == 2 &&
- priv->compose_buffer[1] == GDK_KEY_space)
+ if (n_compose == 2)
{
- gunichar value = 0;
-
switch (priv->compose_buffer[0])
{
case GDK_KEY_dead_doubleacute:
- value = '"'; break;
+ switch (priv->compose_buffer[1])
+ {
+ case GDK_KEY_dead_doubleacute:
+ case GDK_KEY_space:
+ value = '"'; break;
+
+ case 'a': value = GDK_KEY_adiaeresis; break;
+ case 'A': value = GDK_KEY_Adiaeresis; break;
+ case 'e': value = GDK_KEY_ediaeresis; break;
+ case 'E': value = GDK_KEY_Ediaeresis; break;
+ case 'i': value = GDK_KEY_idiaeresis; break;
+ case 'I': value = GDK_KEY_Idiaeresis; break;
+ case 'o': value = GDK_KEY_odiaeresis; break;
+ case 'O': value = GDK_KEY_Odiaeresis; break;
+ case 'u': value = GDK_KEY_udiaeresis; break;
+ case 'U': value = GDK_KEY_Udiaeresis; break;
+ case 'y': value = GDK_KEY_ydiaeresis; break;
+ case 'Y': value = 0x0178; break; /* should be GDK_KEY_Ydiaeresis ?? */
+ }
+ break;
+
+ case GDK_KEY_dead_acute:
+ switch (priv->compose_buffer[1])
+ {
+ case 'c': value = GDK_KEY_ccedilla; break;
+ case 'C': value = GDK_KEY_Ccedilla; break;
+ }
+ break;
}
+ }
- if (value > 0)
- {
- gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
- priv->compose_buffer[0] = 0;
+ if (value > 0)
+ {
+ gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
+ priv->compose_buffer[0] = 0;
- GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
- return TRUE;
- }
+ GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
+ return TRUE;
}
return FALSE;