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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_posix.cc

Issue 19776016: Add files. Does not compile yet! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: builders Created 7 years, 5 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/input/web_input_event_posix.h"
6
7 namespace content {
8
9 ui::KeyboardCode GetWindowsKeyCodeWithoutLocation(ui::KeyboardCode key_code) {
10 switch (key_code) {
11 case ui::VKEY_LCONTROL:
12 case ui::VKEY_RCONTROL:
13 return ui::VKEY_CONTROL;
14 case ui::VKEY_LSHIFT:
15 case ui::VKEY_RSHIFT:
16 return ui::VKEY_SHIFT;
17 case ui::VKEY_LMENU:
18 case ui::VKEY_RMENU:
19 return ui::VKEY_MENU;
20 default:
21 return key_code;
22 }
23 }
24
25 WebKit::WebInputEvent::Modifiers GetLocationModifiersFromWindowsKeyCode(
26 ui::KeyboardCode key_code) {
27 switch (key_code) {
28 case ui::VKEY_LCONTROL:
29 case ui::VKEY_LSHIFT:
30 case ui::VKEY_LMENU:
31 case ui::VKEY_LWIN:
32 return WebKit::WebInputEvent::IsLeft;
33 case ui::VKEY_RCONTROL:
34 case ui::VKEY_RSHIFT:
35 case ui::VKEY_RMENU:
36 case ui::VKEY_RWIN:
37 return WebKit::WebInputEvent::IsRight;
38 default:
39 return static_cast<WebKit::WebInputEvent::Modifiers>(0);
40 }
41 }
42
43 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698