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

Side by Side Diff: ui/base/ime/input_method.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, review Created 9 years, 1 month 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) 2011 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 "ui/base/ime/input_method.h"
6
7 namespace ui {
8
9 InputMethod::~InputMethod() {
10 }
11
12 // We emulate Windows' WM_KEYDOWN and WM_CHAR messages. WM_CHAR events are only
13 // generated for certain keys; see
14 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646268.aspx.
15 bool InputMethod::ShouldSendCharEventForKeyboardCode(KeyboardCode keycode) {
16 if ((keycode >= VKEY_0 && keycode <= VKEY_9) ||
17 (keycode >= VKEY_A && keycode <= VKEY_Z) ||
18 (keycode >= VKEY_NUMPAD0 && keycode <= VKEY_NUMPAD9)) {
19 return true;
20 }
21
22 switch (keycode) {
23 case VKEY_BACK:
24 case VKEY_RETURN:
25 case VKEY_ESCAPE:
26 case VKEY_SPACE:
27 case VKEY_TAB:
28 // In addition to the keys listed at MSDN, we include other
29 // graphic-character and numpad keys.
30 case VKEY_MULTIPLY:
31 case VKEY_ADD:
32 case VKEY_SUBTRACT:
33 case VKEY_DECIMAL:
34 case VKEY_DIVIDE:
35 case VKEY_OEM_1:
36 case VKEY_OEM_2:
37 case VKEY_OEM_3:
38 case VKEY_OEM_4:
39 case VKEY_OEM_5:
40 case VKEY_OEM_6:
41 case VKEY_OEM_7:
42 case VKEY_OEM_102:
43 case VKEY_OEM_PLUS:
44 case VKEY_OEM_COMMA:
45 case VKEY_OEM_MINUS:
46 case VKEY_OEM_PERIOD:
47 return true;
48 default:
49 return false;
50 }
51 }
52
53 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698