-
Notifications
You must be signed in to change notification settings - Fork 29.7k
RawKeyboardWindows: Filter out IME events #77039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RawKeyboardWindows: Filter out IME events #77039
Conversation
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Thank you!
|
On Windows platform, I want to listen to the down event of any key use |
|
@wxw-9527 This is a tricky problem, because even if we somehow hack into |
|
Thank you for your reply. |
|
I see what you're doing here. (By the way, your current short link is broken.) If you can hack into the engine you might want to try |
|
You're great.....(给大哥跪了) (Google Translate) |
|
总的来说,你需要让flutter引擎在程序的窗口创建之前运行win32的ImmDisableIME函数(不需要参数)。我一时能想到有三种方案:
具体怎么做我现在在手机上看不到。如果你摸索不出来我们可以再讨论。 |
|
非常感谢您的回复!我试一试。 |
|
I found the documentation for the ImmDisableIME function, but I didn't find the right place to call this function, because it requires parameters I didn't find in any file under the |
|
A lot of websites mentioned that the parameter should simply be -1 to disable all threads in this process. |
|
I'm very sorry to trouble you again. |
|
What's the compiling error? |
|
use Exception when using |
|
I think it's because you didn't provide the correct lib file to link |
|
Thanks for your help. |
|
Awesome! Glad to know. |
This PR fixes a problem where IME events cause crash in Win32 apps.
This fix that was once landed in flutter/engine#23853 had a flaw: because on Windows, only down events of IME operations has
VK_PROCESSKEYas keyCode, while the accompanying up event uses a normal keycode, filtering events in engine usingVK_PROCESSKEYdoes not exclude the up events.This PR instead filters these events in the framework, since the
RawKeyboardAPI keeps states in the framework.(For the new HardwareKeyboard API, the filtering will be done in the embedding converter.)
Fixes #74819
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.