Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: ui/aura/remote_window_tree_host_win.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/app_list/views/test/apps_grid_view_test_api.cc ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698