OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DOM4_KEYCODE_CONVERTER_H_ | 5 #ifndef UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
6 #define UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 6 #define UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Convert a USB keycode into an equivalent platform native keycode. | 78 // Convert a USB keycode into an equivalent platform native keycode. |
79 static int UsbKeycodeToNativeKeycode(uint32_t usb_keycode); | 79 static int UsbKeycodeToNativeKeycode(uint32_t usb_keycode); |
80 | 80 |
81 // Convert a platform native keycode into an equivalent USB keycode. | 81 // Convert a platform native keycode into an equivalent USB keycode. |
82 static uint32_t NativeKeycodeToUsbKeycode(int native_keycode); | 82 static uint32_t NativeKeycodeToUsbKeycode(int native_keycode); |
83 | 83 |
84 // Convert a USB keycode into the string with the DOM3 |code| value. | 84 // Convert a USB keycode into the string with the DOM3 |code| value. |
85 // The returned pointer references a static global string. | 85 // The returned pointer references a static global string. |
86 static const char* UsbKeycodeToCode(uint32_t usb_keycode); | 86 static const char* UsbKeycodeToCode(uint32_t usb_keycode); |
87 | 87 |
| 88 // Convert a USB keycode into a DomCode. |
| 89 static DomCode UsbKeycodeToDomCode(uint32_t usb_keycode); |
| 90 |
88 // Convert a DOM3 Event |code| string into a USB keycode value. | 91 // Convert a DOM3 Event |code| string into a USB keycode value. |
89 static uint32_t CodeToUsbKeycode(const char* code); | 92 static uint32_t CodeToUsbKeycode(const char* code); |
90 | 93 |
91 // Static methods to support testing. | 94 // Static methods to support testing. |
92 static size_t NumKeycodeMapEntriesForTest(); | 95 static size_t NumKeycodeMapEntriesForTest(); |
93 static const KeycodeMapEntry* GetKeycodeMapForTest(); | 96 static const KeycodeMapEntry* GetKeycodeMapForTest(); |
94 static const char* DomKeyStringForTest(size_t index); | 97 static const char* DomKeyStringForTest(size_t index); |
95 | 98 |
96 private: | 99 private: |
97 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); | 100 DISALLOW_COPY_AND_ASSIGN(KeycodeConverter); |
98 }; | 101 }; |
99 | 102 |
100 } // namespace ui | 103 } // namespace ui |
101 | 104 |
102 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ | 105 #endif // UI_EVENTS_KEYCODES_DOM4_KEYCODE_CONVERTER_H_ |
OLD | NEW |