Matt Wozniski wrote:

> >  > I'm attaching a patch that fixes mapping <s-space> for me, and (for a
> >  > quick test, though I'm not a heavy XIM user) doesn't seem to break
> >  > anything.  All it does is checks if the keycode is "space" and and
> >  > "shift" is pressed, fake a response from XIM saying that it can't
> >  > handle the key.  This seems safe to do, since if the user pressed
> >  > <s-space> when he could have just pressed <space> to insert the same
> >  > character, he was obviously trying to give a special keypress to vim,
> >  > not to XIM.
> >
> >  Note that S-Space is often used to activate XIM.  Better have this patch
> >  checked by some heavy users of XIM to check for any side effects.  Input
> >  Methods are always tricky.
> 
> Yes, but in the particular case of vim compiled with +gui_gtk2, +xim,
> and +hangul_input, we see...
> 
> #ifdef FEAT_XIM
>     if (xim_queue_key_press_event(event, TRUE))
>         return TRUE;
> #endif
> 
> #ifdef FEAT_HANGULIN
>     if (key_sym == GDK_space && (state & GDK_SHIFT_MASK))
>     {
>         hangul_input_state_toggle();
>         return TRUE;
>     }
> #endif
> 
> xim_queue_key_press_event() will consume a shift-space in the default
> GTK2 IM, even though there is no activation key, and there is no way
> to hit the hangul_input_state_toggle() command without changing to an
> input method that doesn't consume shift-space (if there even is one, I
> only played around with a few so far, and they all consumed
> shift-space.)  That behavior can not be considered correct by any
> stretch.

The hangul input code is not very good.  It's only enabled when someone
explicitly asks for it.  Don't use the hangul code to make decisions.

> That being said, if the GTK2 IMs can be set to use shift-space as an
> activation key, my patch is a bit wrong.  It just means that we should
> make sure that (keyval != im_activatekey_keyval || state !=
> im_activatekey_state) in addition to (keyval == GDK_SPACE && state ==
> GDK_SHIFT_MASK), and probably have the entire thing inside an #ifdef
> FEAT_GUI_GTK2/#endif (I misread last night thinking that the whole
> function already was).  Apart from ensuring that we only do this for
> GTK2 GUI's, and that we only do it if shift-space is not the activate
> key, I can't see any way that this could make things worse.

IM stuff is unpredictable, it still needs to be tested to make sure it
works for people in various countries.  There have been many problems
with this code in the past.

-- 
CVS sux, men don't like commitment

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui