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

Side by Side Diff: remoting/host/event_executor_win.cc

Issue 12320014: Switch Pepper Linux to use shared USB<->native key conversion table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missed kInvalidKeycode. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/event_executor_mac.cc ('k') | ui/base/keycodes/usb_keycode_map.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "remoting/host/event_executor.h" 5 #include "remoting/host/event_executor.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 input.ki.time = 0; 190 input.ki.time = 0;
191 input.ki.dwFlags = KEYEVENTF_SCANCODE; 191 input.ki.dwFlags = KEYEVENTF_SCANCODE;
192 if (!event.pressed()) 192 if (!event.pressed())
193 input.ki.dwFlags |= KEYEVENTF_KEYUP; 193 input.ki.dwFlags |= KEYEVENTF_KEYUP;
194 194
195 int scancode = UsbKeycodeToNativeKeycode(event.usb_keycode()); 195 int scancode = UsbKeycodeToNativeKeycode(event.usb_keycode());
196 VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode() 196 VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode()
197 << " to scancode: " << scancode << std::dec; 197 << " to scancode: " << scancode << std::dec;
198 198
199 // Ignore events which can't be mapped. 199 // Ignore events which can't be mapped.
200 if (scancode == kInvalidKeycode) 200 if (scancode == InvalidNativeKeycode())
201 return; 201 return;
202 202
203 // Windows scancodes are only 8-bit, so store the low-order byte into the 203 // Windows scancodes are only 8-bit, so store the low-order byte into the
204 // event and set the extended flag if any high-order bits are set. The only 204 // event and set the extended flag if any high-order bits are set. The only
205 // high-order values we should see are 0xE0 or 0xE1. The extended bit usually 205 // high-order values we should see are 0xE0 or 0xE1. The extended bit usually
206 // distinguishes keys with the same meaning, e.g. left & right shift. 206 // distinguishes keys with the same meaning, e.g. left & right shift.
207 input.ki.wScan = scancode & 0xFF; 207 input.ki.wScan = scancode & 0xFF;
208 if ((scancode & 0xFF00) != 0x0000) { 208 if ((scancode & 0xFF00) != 0x0000) {
209 input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY; 209 input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
210 } 210 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } // namespace 302 } // namespace
303 303
304 scoped_ptr<EventExecutor> EventExecutor::Create( 304 scoped_ptr<EventExecutor> EventExecutor::Create(
305 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 305 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
306 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 306 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
307 return scoped_ptr<EventExecutor>( 307 return scoped_ptr<EventExecutor>(
308 new EventExecutorWin(main_task_runner, ui_task_runner)); 308 new EventExecutorWin(main_task_runner, ui_task_runner));
309 } 309 }
310 310
311 } // namespace remoting 311 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/event_executor_mac.cc ('k') | ui/base/keycodes/usb_keycode_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698