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

Side by Side Diff: ui/events/ozone/layout/layout_util.h

Issue 786813004: Generate correct KeyboardCode (VKEY). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@x430194-xkb
Patch Set: Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_OZONE_LAYOUT_LAYOUT_UTIL_H_ 5 #ifndef UI_EVENTS_OZONE_LAYOUT_LAYOUT_UTIL_H_
6 #define UI_EVENTS_OZONE_LAYOUT_LAYOUT_UTIL_H_ 6 #define UI_EVENTS_OZONE_LAYOUT_LAYOUT_UTIL_H_
7 7
8 // TODO(kpschoedel): consider moving this out of Ozone. 8 // TODO(kpschoedel): consider moving this out of Ozone.
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "ui/events/keycodes/keyboard_codes.h" 11 #include "ui/events/keycodes/keyboard_codes.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 enum class DomCode; 15 enum class DomCode;
16 enum class DomKey; 16 enum class DomKey;
17 17
18 // Returns a Windows-based VKEY for a non-printable DOM Level 3 |key|.
19 // The returned VKEY is non-located (e.g. VKEY_SHIFT).
20 KeyboardCode NonPrintableDomKeyToKeyboardCode(DomKey dom_key);
21
18 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|. 22 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|.
19 // The returned VKEY is located (e.g. VKEY_LSHIFT). 23 // The returned VKEY is located (e.g. VKEY_LSHIFT).
20 KeyboardCode DomCodeToKeyboardCode(DomCode dom_code); 24 KeyboardCode DomCodeToKeyboardCode(DomCode dom_code);
21 25
22 // Returns a Windows-based VKEY for a non-printable DOM Level 3 |key|. 26 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|.
23 // The returned VKEY is non-located (e.g. VKEY_SHIFT). 27 // The returned VKEY is non-located (e.g. VKEY_SHIFT).
24 KeyboardCode NonPrintableDomKeyToKeyboardCode(DomKey dom_key); 28 KeyboardCode DomCodeToNonLocatedKeyboardCode(DomCode dom_code);
25 29
26 // Determine the non-located VKEY corresponding to a located VKEY. 30 // Determine the non-located VKEY corresponding to a located VKEY.
27 KeyboardCode DeLocateKeyboardCode(KeyboardCode key_code); 31 KeyboardCode NonLocatedKeyboardCode(KeyboardCode key_code);
32
33 // Determine the located VKEY corresponding to a non-located VKEY.
34 KeyboardCode LocatedKeyboardCode(KeyboardCode key_code, DomCode dom_code);
28 35
29 // Returns true control character corresponding to a physical key. 36 // Returns true control character corresponding to a physical key.
30 // In some contexts this is used instead of the key layout. 37 // In some contexts this is used instead of the key layout.
31 bool LookupControlCharacter(DomCode dom_code, 38 bool LookupControlCharacter(DomCode dom_code,
32 int flags, 39 int flags,
33 DomKey* dom_key, 40 DomKey* dom_key,
34 base::char16* character, 41 base::char16* character,
35 KeyboardCode* key_code); 42 KeyboardCode* key_code);
36 43
37 } // namespace ui 44 } // namespace ui
38 45
39 #endif // UI_EVENTS_OZONE_LAYOUT_LAYOUT_UTIL_H_ 46 #endif // UI_EVENTS_OZONE_LAYOUT_LAYOUT_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698