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

Side by Side Diff: ui/base/keycodes/keyboard_code_conversion.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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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/base/keycodes/keyboard_code_conversion.h" 5 #include "ui/base/keycodes/keyboard_code_conversion.h"
6 6
7 #include "ui/base/events.h" 7 #include "ui/base/events.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // ctrl-Enter maps to \x0A (Line feed) 49 // ctrl-Enter maps to \x0A (Line feed)
50 case VKEY_RETURN: 50 case VKEY_RETURN:
51 return 0x0A; 51 return 0x0A;
52 // Returns 0 for all other keys to avoid inputting unexpected chars. 52 // Returns 0 for all other keys to avoid inputting unexpected chars.
53 default: 53 default:
54 return 0; 54 return 0;
55 } 55 }
56 } 56 }
57 } 57 }
58 58
59 // For IME support
60 if (key_code == ui::VKEY_PROCESSKEY)
61 return 0xE5;
James Su 2011/11/21 08:23:36 Why do we need it?
Yusuke Sato 2011/11/22 11:09:30 I think this is necessary to allow RWHVA::OnKeyEve
62
59 // Normal characters 63 // Normal characters
60 if (key_code >= VKEY_0 && key_code <= VKEY_9) { 64 if (key_code >= VKEY_0 && key_code <= VKEY_9) {
61 return shift ? ")!@#$%^&*("[key_code - VKEY_0] : 65 return shift ? ")!@#$%^&*("[key_code - VKEY_0] :
62 static_cast<uint16>(key_code); 66 static_cast<uint16>(key_code);
63 } else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9) { 67 } else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9) {
64 return key_code - VKEY_NUMPAD0 + '0'; 68 return key_code - VKEY_NUMPAD0 + '0';
65 } 69 }
66 70
67 switch (key_code) { 71 switch (key_code) {
68 case VKEY_TAB: 72 case VKEY_TAB:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 case VKEY_OEM_6: 106 case VKEY_OEM_6:
103 return shift ? '}' : ']'; 107 return shift ? '}' : ']';
104 case VKEY_OEM_7: 108 case VKEY_OEM_7:
105 return shift ? '"' : '\''; 109 return shift ? '"' : '\'';
106 default: 110 default:
107 return 0; 111 return 0;
108 } 112 }
109 } 113 }
110 114
111 } // namespace ui 115 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698