L
Lloyd Dupont
I wrote a simple control doing custom text handling. (No, I can't use a text
box).
I have a problem with it when entering international text through the IME
window.
If you test the very simple sample below:
class MyControl : Control
{
protected override OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
Console.WriteLine("{0} - {1}({2})", e.Handled, e.KeyChar,
(int)e.KeyChar);
}
}
And try to activate, say, the Japaneese IME window and enter some text,
you'll see that the text entered through the Japaneese IME goes twice in
OnKeyPress.
I tried something like
protected override bool ProcessKeyEventArgs(ref Message m)
{
if (m.Msg == (int)WindowMessage.WM_IME_CHAR)
return false;
return base.ProcessKeyEventArgs(ref m);
}
It seems to work.
But then I don't really understand what's going on....
Care to comment?
--
Regards,
Lloyd Dupont
NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
box).
I have a problem with it when entering international text through the IME
window.
If you test the very simple sample below:
class MyControl : Control
{
protected override OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
Console.WriteLine("{0} - {1}({2})", e.Handled, e.KeyChar,
(int)e.KeyChar);
}
}
And try to activate, say, the Japaneese IME window and enter some text,
you'll see that the text entered through the Japaneese IME goes twice in
OnKeyPress.
I tried something like
protected override bool ProcessKeyEventArgs(ref Message m)
{
if (m.Msg == (int)WindowMessage.WM_IME_CHAR)
return false;
return base.ProcessKeyEventArgs(ref m);
}
It seems to work.
But then I don't really understand what's going on....
Care to comment?
--
Regards,
Lloyd Dupont
NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>