Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
|
dtapuska
2016/01/21 01:59:36
2016
chongz
2016/01/21 15:47:40
Acknowledged.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_LOOKUP_WIN_H_ | |
| 6 #define UI_EVENTS_KEYCODES_KEYBOARD_LOOKUP_WIN_H_ | |
| 7 | |
| 8 #include <windows.h> | |
| 9 | |
| 10 #include "ui/events/event_constants.h" | |
| 11 #include "ui/events/events_base_export.h" | |
| 12 #include "ui/events/keycodes/dom/dom_key.h" | |
| 13 #include "ui/events/keycodes/keyboard_codes_win.h" | |
| 14 | |
| 15 namespace ui { | |
| 16 | |
| 17 class EVENTS_BASE_EXPORT WindowsKeyboardLookup { | |
| 18 public: | |
| 19 static WindowsKeyboardLookup* Create(HKL alayout); | |
|
dtapuska
2016/01/21 01:59:36
You likely want to hold return this as a scoped_pt
chongz
2016/01/21 15:47:40
Will just expose constructor
| |
| 20 | |
| 21 static DomKey VirtualKeyToCurrentLayoutDomKey(KeyboardCode vkcode, | |
| 22 int event_flags); | |
| 23 DomKey VirtualKeyToDomKey(KeyboardCode vkcode, int event_flags) const; | |
| 24 | |
| 25 private: | |
| 26 WindowsKeyboardLookup(): keyboard_layout_(nullptr) {} | |
| 27 | |
| 28 void CheckOrLoadLayout(HKL alayout); | |
| 29 void SetModifierState(BYTE *keyboard_state, int event_flags) const; | |
| 30 | |
| 31 size_t GetEventFlagsIndex(int event_flags) const; | |
|
dtapuska
2016/01/21 01:59:36
I think these three things can just be in anonymou
chongz
2016/01/21 15:47:40
Acknowledged.
| |
| 32 int EventFlagsFromIndex(size_t index) const; | |
| 33 static const EventFlags event_flags_index[]; | |
| 34 | |
| 35 static const size_t kMaxVirtualKeyCode = 256; | |
| 36 static const size_t kMaxKeyboardModifier = 1 << 8; | |
| 37 | |
| 38 HKL keyboard_layout_; | |
| 39 DomKey lookup_table_[kMaxVirtualKeyCode][kMaxKeyboardModifier]; | |
| 40 | |
| 41 static WindowsKeyboardLookup* GetInstance(); | |
| 42 }; | |
| 43 | |
| 44 } // namespace ui | |
| 45 | |
| 46 #endif // UI_EVENTS_KEYCODES_KEYBOARD_LOOKUP_WIN_H_ | |
| OLD | NEW |