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

Side by Side Diff: ui/events/keycodes/keyboard_code_conversion.h

Issue 1550953002: Keyboard events with keypad had wrong keycodes on ozone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 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 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ 5 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_
6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ 6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/events/events_base_export.h" 10 #include "ui/events/events_base_export.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // (e.g. VKEY_NUMPAD1 on the number pad vs VKEY_1 on the main keyboard), 73 // (e.g. VKEY_NUMPAD1 on the number pad vs VKEY_1 on the main keyboard),
74 // except that in this case the main keyboard code doubles as the 74 // except that in this case the main keyboard code doubles as the
75 // non-located value. 75 // non-located value.
76 EVENTS_BASE_EXPORT KeyboardCode 76 EVENTS_BASE_EXPORT KeyboardCode
77 LocatedToNonLocatedKeyboardCode(KeyboardCode key_code); 77 LocatedToNonLocatedKeyboardCode(KeyboardCode key_code);
78 78
79 // Determine the located VKEY corresponding to a non-located VKEY. 79 // Determine the located VKEY corresponding to a non-located VKEY.
80 EVENTS_BASE_EXPORT KeyboardCode 80 EVENTS_BASE_EXPORT KeyboardCode
81 NonLocatedToLocatedKeyboardCode(KeyboardCode key_code, DomCode dom_code); 81 NonLocatedToLocatedKeyboardCode(KeyboardCode key_code, DomCode dom_code);
82 82
83 // Determine the located VKEY corresponding to a non-located VKEY for
84 // keypad vkeys. (eg. VKEY_1 (with DomCode::NUMPAD1 maps to VKEY_NUMPAD1).
85 EVENTS_BASE_EXPORT KeyboardCode
86 NonLocatedToLocatedKeypadKeyboardCode(KeyboardCode key_code, DomCode dom_code);
87
83 // Returns a DOM Level 3 |code| from a Windows-based VKEY value. 88 // Returns a DOM Level 3 |code| from a Windows-based VKEY value.
84 // This assumes a US layout and should only be used when |code| cannot be 89 // This assumes a US layout and should only be used when |code| cannot be
85 // determined from a physical scan code, for example when a key event was 90 // determined from a physical scan code, for example when a key event was
86 // generated synthetically by JavaScript with only a VKEY value supplied. 91 // generated synthetically by JavaScript with only a VKEY value supplied.
87 EVENTS_BASE_EXPORT DomCode UsLayoutKeyboardCodeToDomCode(KeyboardCode key_code); 92 EVENTS_BASE_EXPORT DomCode UsLayoutKeyboardCodeToDomCode(KeyboardCode key_code);
88 93
89 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, 94 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|,
90 // assuming a base US English layout. The returned VKEY is located 95 // assuming a base US English layout. The returned VKEY is located
91 // (e.g. VKEY_LSHIFT). 96 // (e.g. VKEY_LSHIFT).
92 EVENTS_BASE_EXPORT KeyboardCode DomCodeToUsLayoutKeyboardCode(DomCode dom_code); 97 EVENTS_BASE_EXPORT KeyboardCode DomCodeToUsLayoutKeyboardCode(DomCode dom_code);
93 98
94 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, 99 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|,
95 // assuming a base US English layout. The returned VKEY is non-located 100 // assuming a base US English layout. The returned VKEY is non-located
96 // (e.g. VKEY_SHIFT). 101 // (e.g. VKEY_SHIFT).
97 EVENTS_BASE_EXPORT KeyboardCode 102 EVENTS_BASE_EXPORT KeyboardCode
98 DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code); 103 DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code);
99 104
100 } // namespace ui 105 } // namespace ui
101 106
102 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ 107 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/web_input_event_aura.cc ('k') | ui/events/keycodes/keyboard_code_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698