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

Unified Diff: ui/events/keycodes/keyboard_code_conversion.h

Issue 1085733007: Revert of Take GetCharacterFromKeyCode() out behind the barn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/keycodes/dom_us_layout_data.h ('k') | ui/events/keycodes/keyboard_code_conversion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/keycodes/keyboard_code_conversion.h
diff --git a/ui/events/keycodes/keyboard_code_conversion.h b/ui/events/keycodes/keyboard_code_conversion.h
index 4370a7b1fe614e8cfa88409ecad6ad12229d69d7..8b92ba16394eaaebd48ccbacd86bed3ec453bc99 100644
--- a/ui/events/keycodes/keyboard_code_conversion.h
+++ b/ui/events/keycodes/keyboard_code_conversion.h
@@ -15,7 +15,7 @@
enum class DomCode;
enum class DomKey;
-// Helper functions to get the meaning of a DOM |code| in a
+// Helper functions to get the meaning of a Windows key code in a
// platform independent way. It supports control characters as well.
// It assumes a US keyboard layout is used, so it may only be used when there
// is no native event or no better way to get the character.
@@ -29,6 +29,16 @@
// character according to US keyboard layout definition. Preferably, such
// events should be created using a full KeyEvent constructor, explicitly
// specifying the character and DOM 3 values as well as the legacy VKEY.
+//
+// TODO(kpschoedel): replace remaining uses of the ...FromKeyCode() functions
+// and remove them, to avoid future creation of underspecified key events.
+// crbug.com/444045
+EVENTS_BASE_EXPORT base::char16 GetCharacterFromKeyCode(KeyboardCode key_code,
+ int flags);
+EVENTS_BASE_EXPORT bool GetMeaningFromKeyCode(KeyboardCode key_code,
+ int flags,
+ DomKey* dom_key,
+ base::char16* character);
// Helper function to map a physical key state (dom_code and flags)
// to a meaning (dom_key and character, together corresponding to the
@@ -40,8 +50,6 @@
// Returns true and sets the output parameters if the (dom_code, flags) pair
// has an interpretation in the US English layout; otherwise the output
// parameters are untouched.
-EVENTS_BASE_EXPORT base::char16 DomCodeToUsLayoutCharacter(DomCode dom_code,
- int flags);
EVENTS_BASE_EXPORT bool DomCodeToUsLayoutMeaning(DomCode dom_code,
int flags,
DomKey* dom_key,
« no previous file with comments | « ui/events/keycodes/dom_us_layout_data.h ('k') | ui/events/keycodes/keyboard_code_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698