Make C-u commit and restart hex input if we are already in a hex sequence.

2005-09-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkimcontextsimple.c (gtk_im_context_simple_filter_keypress):
	Make C-u commit and restart hex input if we are already in a
	hex sequence.
This commit is contained in:
Matthias Clasen 2005-09-07 17:02:47 +00:00 committed by Matthias Clasen
parent 2726ffafe3
commit 78ea5d7ed2
3 changed files with 35 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-09-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_filter_keypress):
Make C-u commit and restart hex input if we are already in a
hex sequence.
2005-09-06 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkkeys-x11.c (update_modmap): Make the modmap reflexive.

View File

@ -1,3 +1,9 @@
2005-09-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_filter_keypress):
Make C-u commit and restart hex input if we are already in a
hex sequence.
2005-09-06 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkkeys-x11.c (update_modmap): Make the modmap reflexive.

View File

@ -1381,7 +1381,8 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
if (!have_hex_mods ||
(n_compose > 0 && !context_simple->in_hex_sequence) ||
(n_compose == 0 && !context_simple->in_hex_sequence && !is_hex_start) ||
(context_simple->in_hex_sequence && !hex_keyval && !is_space && !is_backspace))
(context_simple->in_hex_sequence && !hex_keyval &&
!is_hex_start && !is_space && !is_backspace))
{
if (event->state & (gtk_accelerator_get_default_mod_mask () & ~GDK_SHIFT_MASK))
return FALSE;
@ -1406,8 +1407,28 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
return TRUE;
}
if (context_simple->in_hex_sequence && have_hex_mods && is_hex_start)
{
if (context_simple->tentative_match &&
g_unichar_validate (context_simple->tentative_match))
{
gtk_im_context_simple_commit_char (context, context_simple->tentative_match);
context_simple->compose_buffer[0] = 0;
}
else
{
/* invalid hex sequence */
if (n_compose > 0)
gdk_display_beep (gdk_drawable_get_display (event->window));
context_simple->tentative_match = 0;
context_simple->in_hex_sequence = FALSE;
context_simple->compose_buffer[0] = 0;
}
}
/* Check for hex sequence start */
if (n_compose == 0 && !context_simple->in_hex_sequence && have_hex_mods && is_hex_start)
if (!context_simple->in_hex_sequence && have_hex_mods && is_hex_start)
{
context_simple->compose_buffer[0] = 0;
context_simple->in_hex_sequence = TRUE;