| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_KEYBOARD_CODE_CONVERSION_H_ | 5 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ |
| 6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ | 6 #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/events/events_base_export.h" | 10 #include "ui/events/events_base_export.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // (e.g. VKEY_NUMPAD1 on the number pad vs VKEY_1 on the main keyboard), | 73 // (e.g. VKEY_NUMPAD1 on the number pad vs VKEY_1 on the main keyboard), |
| 74 // except that in this case the main keyboard code doubles as the | 74 // except that in this case the main keyboard code doubles as the |
| 75 // non-located value. | 75 // non-located value. |
| 76 EVENTS_BASE_EXPORT KeyboardCode | 76 EVENTS_BASE_EXPORT KeyboardCode |
| 77 LocatedToNonLocatedKeyboardCode(KeyboardCode key_code); | 77 LocatedToNonLocatedKeyboardCode(KeyboardCode key_code); |
| 78 | 78 |
| 79 // Determine the located VKEY corresponding to a non-located VKEY. | 79 // Determine the located VKEY corresponding to a non-located VKEY. |
| 80 EVENTS_BASE_EXPORT KeyboardCode | 80 EVENTS_BASE_EXPORT KeyboardCode |
| 81 NonLocatedToLocatedKeyboardCode(KeyboardCode key_code, DomCode dom_code); | 81 NonLocatedToLocatedKeyboardCode(KeyboardCode key_code, DomCode dom_code); |
| 82 | 82 |
| 83 // Determine the located VKEY corresponding to a non-located VKEY for |
| 84 // keypad vkeys. (eg. VKEY_1 (with DomCode::NUMPAD1 maps to VKEY_NUMPAD1). |
| 85 EVENTS_BASE_EXPORT KeyboardCode |
| 86 NonLocatedToLocatedKeypadKeyboardCode(KeyboardCode key_code, DomCode dom_code); |
| 87 |
| 83 // Returns a DOM Level 3 |code| from a Windows-based VKEY value. | 88 // Returns a DOM Level 3 |code| from a Windows-based VKEY value. |
| 84 // This assumes a US layout and should only be used when |code| cannot be | 89 // This assumes a US layout and should only be used when |code| cannot be |
| 85 // determined from a physical scan code, for example when a key event was | 90 // determined from a physical scan code, for example when a key event was |
| 86 // generated synthetically by JavaScript with only a VKEY value supplied. | 91 // generated synthetically by JavaScript with only a VKEY value supplied. |
| 87 EVENTS_BASE_EXPORT DomCode UsLayoutKeyboardCodeToDomCode(KeyboardCode key_code); | 92 EVENTS_BASE_EXPORT DomCode UsLayoutKeyboardCodeToDomCode(KeyboardCode key_code); |
| 88 | 93 |
| 89 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, | 94 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, |
| 90 // assuming a base US English layout. The returned VKEY is located | 95 // assuming a base US English layout. The returned VKEY is located |
| 91 // (e.g. VKEY_LSHIFT). | 96 // (e.g. VKEY_LSHIFT). |
| 92 EVENTS_BASE_EXPORT KeyboardCode DomCodeToUsLayoutKeyboardCode(DomCode dom_code); | 97 EVENTS_BASE_EXPORT KeyboardCode DomCodeToUsLayoutKeyboardCode(DomCode dom_code); |
| 93 | 98 |
| 94 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, | 99 // Returns the Windows-based VKEY value corresponding to a DOM Level 3 |code|, |
| 95 // assuming a base US English layout. The returned VKEY is non-located | 100 // assuming a base US English layout. The returned VKEY is non-located |
| 96 // (e.g. VKEY_SHIFT). | 101 // (e.g. VKEY_SHIFT). |
| 97 EVENTS_BASE_EXPORT KeyboardCode | 102 EVENTS_BASE_EXPORT KeyboardCode |
| 98 DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code); | 103 DomCodeToUsLayoutNonLocatedKeyboardCode(DomCode dom_code); |
| 99 | 104 |
| 100 } // namespace ui | 105 } // namespace ui |
| 101 | 106 |
| 102 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ | 107 #endif // UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_ |
| OLD | NEW |