Re: Using ALT key with double-byte encoding
- Yasuhiro Matsumoto wrote:
> On Sat, Mar 20, 2004 at 01:38:43PM +0100, Bram Moolenaar wrote:Did you mean "console" here?
> > A long time ago Yasuhiro Matsumoto reported that mapping <M-x> doesn't
> > work when using a double-byte encoding. I now looked into this and came
> > to the conclusion that the solution is to avoid setting the 8th bit of
> > the character. If we do this everywhere and use the ALT modifier it
> > should work.
> > However, I can only partly test this. Please try out the patch below.
> Sorry, i might report without the way of reproduce.
> on GTK, it _already_ can work with <m-x>.
> These are the environments which don't work with <m-x>
> 1. win32 gui
> can't map <m-x>.
> if type <m-x> 2 times on insert mode,
> 0xf8f8 is appear.
> 2. win32 gui
> same as win32 gui.
> I guess that vgetorpeek() cause this problem.I thought I already said a few times that this is the wrong solution.
> Some encoding have <m-x> in trail-byte.
> i.e. even if i apply your patch, i can't input <m-x>.
> With following patch, vgetorpeek accept <m-x> if typebuf have only
> one character.
It will cause trouble for when the double-byte character is mapped and
is a hack anyway.
The right solution is to pass <M-x> not as a 'x' with the 8th bit set
but as a 'x' with the ALT modifier. Apparently that doesn't happen
yet on Win32.
Strange, I would think the change in misc2.c does solve this. Perhaps
you can find out what happens in extract_modifiers() when typing <M-x>?
In a world without walls and borders, who needs windows and gates?
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///