Chromium Code Reviews| Index: win8/metro_driver/metro_driver_win7.cc |
| diff --git a/win8/metro_driver/metro_driver_win7.cc b/win8/metro_driver/metro_driver_win7.cc |
| index 3ace04caee0a06327e53b95281b2c12e2be42b5c..1bcf1a8ebfb36823d554885f3735ad47fe5aa584 100644 |
| --- a/win8/metro_driver/metro_driver_win7.cc |
| +++ b/win8/metro_driver/metro_driver_win7.cc |
| @@ -463,7 +463,6 @@ class CoreDispatcherEmulation : |
| MSG msg = {0}; |
| while((::GetMessage(&msg, NULL, 0, 0) != 0) && g_window_count > 0) { |
| ProcessInputMessage(msg); |
| - ::TranslateMessage(&msg); |
| ::DispatchMessage(&msg); |
|
yukawa
2015/08/05 21:23:36
Can you leave a comment about why ::TranslateMessa
Shu Chen
2015/08/06 01:35:51
Done.
|
| } |
| // TODO(cpu): figure what to do with msg.WParam which we would normally |
| @@ -913,6 +912,20 @@ class CoreWindowEmulation |
| switch (msg.message) { |
| case WM_KEYDOWN: |
| case WM_KEYUP: { |
| + ::TranslateMessage(&msg); |
| + // Peek & remove the following messages in the message queue. |
| + // - WM_CHAR (0x0102) |
| + // - WM_DEADCHAR (0x0103) |
| + // And only process WM_CHAR message in browser. |
| + MSG char_msg; |
| + while (::PeekMessage(&char_msg, msg.hwnd, WM_CHAR, WM_DEADCHAR, |
| + PM_REMOVE)) { |
| + if (char_msg.message == WM_DEADCHAR) |
| + continue; |
| + mswr::ComPtr<winui::Core::ICharacterReceivedEventArgs> char_args; |
| + char_args = mswr::Make<KeyEvent>(char_msg); |
| + character_received_handler_->Invoke(this, char_args.Get()); |
| + } |
| mswr::ComPtr<winui::Core::IKeyEventArgs> event_args; |
| event_args = mswr::Make<KeyEvent>(msg); |
| KeyEventHandler* handler = NULL; |
| @@ -925,15 +938,6 @@ class CoreWindowEmulation |
| break; |
| } |
| - case WM_CHAR: |
| - case WM_DEADCHAR: |
| - case WM_UNICHAR: { |
|
yukawa
2015/08/05 21:23:36
I supposed removing WM_UNICHAR support does not af
Shu Chen
2015/08/06 01:35:51
Removing WM_UNICHAR here doesn't change the existi
yukawa
2015/08/06 01:45:51
Is there any chance that unhandled WM_UNICHAR was
Shu Chen
2015/08/07 07:15:23
I've removed the WM_DEADCHAR & WM_UNICHAR here, an
|
| - mswr::ComPtr<winui::Core::ICharacterReceivedEventArgs> event_args; |
| - event_args = mswr::Make<KeyEvent>(msg); |
| - character_received_handler_->Invoke(this, event_args.Get()); |
| - break; |
| - } |
| - |
| default: |
| return false; |
| } |