OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/remote_window_tree_host_win.h" | 5 #include "ui/aura/remote_window_tree_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 const int keydown_message[] = {WM_KEYDOWN, WM_SYSKEYDOWN}; | 492 const int keydown_message[] = {WM_KEYDOWN, WM_SYSKEYDOWN}; |
493 const int keyup_message[] = {WM_KEYUP, WM_SYSKEYUP}; | 493 const int keyup_message[] = {WM_KEYUP, WM_SYSKEYUP}; |
494 uint32 message = is_character | 494 uint32 message = is_character |
495 ? char_message[index] | 495 ? char_message[index] |
496 : (type == ui::ET_KEY_PRESSED ? keydown_message[index] | 496 : (type == ui::ET_KEY_PRESSED ? keydown_message[index] |
497 : keyup_message[index]); | 497 : keyup_message[index]); |
498 ::PostThreadMessage(::GetCurrentThreadId(), | 498 ::PostThreadMessage(::GetCurrentThreadId(), |
499 message, | 499 message, |
500 vkey, | 500 vkey, |
501 repeat_count | scan_code >> 15); | 501 repeat_count | scan_code >> 15); |
| 502 } else if (is_character) { |
| 503 ui::KeyEvent event(static_cast<base::char16>(vkey), |
| 504 ui::KeyboardCodeForWindowsKeyCode(vkey), |
| 505 flags); |
| 506 SendEventToProcessor(&event); |
502 } else { | 507 } else { |
503 ui::KeyEvent event(type, | 508 ui::KeyEvent event(type, |
504 ui::KeyboardCodeForWindowsKeyCode(vkey), | 509 ui::KeyboardCodeForWindowsKeyCode(vkey), |
505 flags, | 510 flags); |
506 is_character); | |
507 SendEventToProcessor(&event); | 511 SendEventToProcessor(&event); |
508 } | 512 } |
509 } | 513 } |
510 | 514 |
511 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 515 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
512 if (flags == event_flags_) | 516 if (flags == event_flags_) |
513 return; | 517 return; |
514 event_flags_ = flags; | 518 event_flags_ = flags; |
515 SetVirtualKeyStates(event_flags_); | 519 SetVirtualKeyStates(event_flags_); |
516 } | 520 } |
517 | 521 |
518 } // namespace aura | 522 } // namespace aura |
OLD | NEW |