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

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

Issue 1776673007: [Windows] Produce correct DomKey for NumPad when combined with Shift/NumLock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wez's review 2 Created 4 years, 9 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/events.gyp ('k') | ui/events/keycodes/platform_key_map_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/keycodes/platform_key_map_win.h
diff --git a/ui/events/keycodes/platform_key_map_win.h b/ui/events/keycodes/platform_key_map_win.h
index 7517f2a7ee470d2a78bc7b0a6a88f935dbeffe5d..6d128a7a5dce20b165db316f592d52b145c9c5eb 100644
--- a/ui/events/keycodes/platform_key_map_win.h
+++ b/ui/events/keycodes/platform_key_map_win.h
@@ -9,8 +9,9 @@
#include <unordered_map>
+#include "base/event_types.h"
#include "base/hash.h"
-#include "ui/events/events_base_export.h"
+#include "ui/events/events_export.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/keyboard_codes_win.h"
@@ -18,27 +19,31 @@ namespace ui {
enum class DomCode;
-class EVENTS_BASE_EXPORT PlatformKeyMap {
+class EVENTS_EXPORT PlatformKeyMap {
public:
// Create and load key map table with specified keyboard layout.
+ // Visible for testing.
explicit PlatformKeyMap(HKL layout);
~PlatformKeyMap();
- // Returns the DomKey 'meaning' of |code| in the context of specified
- // |ui_event_flags| and stored keyboard layout.
- DomKey DomCodeAndFlagsToDomKey(DomCode code,
- int ui_event_flags) const;
-
- // Returns the DomKey 'meaning' of |code| in the context of specified
- // |ui_event_flags| and the keyboard layout of current thread.
+ // Returns the DOM KeyboardEvent key from a native event and the keyboard
+ // layout of current thread.
// Updates a per-thread key map cache whenever the layout changes.
- static DomKey DomCodeAndFlagsToDomKeyStatic(
- DomCode code,
- int ui_event_flags);
+ static DomKey DomKeyFromNative(const base::NativeEvent& native_event);
private:
+ friend class PlatformKeyMapTest;
+
PlatformKeyMap();
+ // TODO(chongz): Expose this function when we need to access separate layout.
+ // Returns the DomKey 'meaning' of |code| in the context of specified
+ // |ui_event_flags| and stored keyboard layout.
+ // |key_code| will only be used for NumPad.
+ DomKey DomKeyFromNativeImpl(DomCode code,
+ KeyboardCode key_code,
+ int ui_event_flags) const;
+
// TODO(chongz): Expose this function in response to WM_INPUTLANGCHANGE.
void UpdateLayout(HKL layout);
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/keycodes/platform_key_map_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698