22#include <com/sun/star/awt/Key.hpp>
23#include <com/sun/star/lang/IllegalArgumentException.hpp>
33 {css::awt::Key::NUM0 ,
"KEY_0" },
34 {css::awt::Key::NUM1 ,
"KEY_1" },
35 {css::awt::Key::NUM2 ,
"KEY_2" },
36 {css::awt::Key::NUM3 ,
"KEY_3" },
37 {css::awt::Key::NUM4 ,
"KEY_4" },
38 {css::awt::Key::NUM5 ,
"KEY_5" },
39 {css::awt::Key::NUM6 ,
"KEY_6" },
40 {css::awt::Key::NUM7 ,
"KEY_7" },
41 {css::awt::Key::NUM8 ,
"KEY_8" },
42 {css::awt::Key::NUM9 ,
"KEY_9" },
43 {css::awt::Key::A ,
"KEY_A" },
44 {css::awt::Key::B ,
"KEY_B" },
45 {css::awt::Key::C ,
"KEY_C" },
46 {css::awt::Key::D ,
"KEY_D" },
47 {css::awt::Key::E ,
"KEY_E" },
48 {css::awt::Key::F ,
"KEY_F" },
49 {css::awt::Key::G ,
"KEY_G" },
50 {css::awt::Key::H ,
"KEY_H" },
51 {css::awt::Key::I ,
"KEY_I" },
52 {css::awt::Key::J ,
"KEY_J" },
53 {css::awt::Key::K ,
"KEY_K" },
54 {css::awt::Key::L ,
"KEY_L" },
55 {css::awt::Key::M ,
"KEY_M" },
56 {css::awt::Key::N ,
"KEY_N" },
57 {css::awt::Key::O ,
"KEY_O" },
58 {css::awt::Key::P ,
"KEY_P" },
59 {css::awt::Key::Q ,
"KEY_Q" },
60 {css::awt::Key::R ,
"KEY_R" },
61 {css::awt::Key::S ,
"KEY_S" },
62 {css::awt::Key::T ,
"KEY_T" },
63 {css::awt::Key::U ,
"KEY_U" },
64 {css::awt::Key::V ,
"KEY_V" },
65 {css::awt::Key::W ,
"KEY_W" },
66 {css::awt::Key::X ,
"KEY_X" },
67 {css::awt::Key::Y ,
"KEY_Y" },
68 {css::awt::Key::Z ,
"KEY_Z" },
69 {css::awt::Key::F1 ,
"KEY_F1" },
70 {css::awt::Key::F2 ,
"KEY_F2" },
71 {css::awt::Key::F3 ,
"KEY_F3" },
72 {css::awt::Key::F4 ,
"KEY_F4" },
73 {css::awt::Key::F5 ,
"KEY_F5" },
74 {css::awt::Key::F6 ,
"KEY_F6" },
75 {css::awt::Key::F7 ,
"KEY_F7" },
76 {css::awt::Key::F8 ,
"KEY_F8" },
77 {css::awt::Key::F9 ,
"KEY_F9" },
78 {css::awt::Key::F10 ,
"KEY_F10" },
79 {css::awt::Key::F11 ,
"KEY_F11" },
80 {css::awt::Key::F12 ,
"KEY_F12" },
81 {css::awt::Key::F13 ,
"KEY_F13" },
82 {css::awt::Key::F14 ,
"KEY_F14" },
83 {css::awt::Key::F15 ,
"KEY_F15" },
84 {css::awt::Key::F16 ,
"KEY_F16" },
85 {css::awt::Key::F17 ,
"KEY_F17" },
86 {css::awt::Key::F18 ,
"KEY_F18" },
87 {css::awt::Key::F19 ,
"KEY_F19" },
88 {css::awt::Key::F20 ,
"KEY_F20" },
89 {css::awt::Key::F21 ,
"KEY_F21" },
90 {css::awt::Key::F22 ,
"KEY_F22" },
91 {css::awt::Key::F23 ,
"KEY_F23" },
92 {css::awt::Key::F24 ,
"KEY_F24" },
93 {css::awt::Key::F25 ,
"KEY_F25" },
94 {css::awt::Key::F26 ,
"KEY_F26" },
95 {css::awt::Key::DOWN ,
"KEY_DOWN" },
96 {css::awt::Key::UP ,
"KEY_UP" },
97 {css::awt::Key::LEFT ,
"KEY_LEFT" },
98 {css::awt::Key::RIGHT ,
"KEY_RIGHT" },
99 {css::awt::Key::HOME ,
"KEY_HOME" },
100 {css::awt::Key::END ,
"KEY_END" },
101 {css::awt::Key::PAGEUP ,
"KEY_PAGEUP" },
102 {css::awt::Key::PAGEDOWN ,
"KEY_PAGEDOWN" },
103 {css::awt::Key::RETURN ,
"KEY_RETURN" },
104 {css::awt::Key::ESCAPE ,
"KEY_ESCAPE" },
105 {css::awt::Key::TAB ,
"KEY_TAB" },
106 {css::awt::Key::BACKSPACE ,
"KEY_BACKSPACE" },
107 {css::awt::Key::SPACE ,
"KEY_SPACE" },
108 {css::awt::Key::INSERT ,
"KEY_INSERT" },
109 {css::awt::Key::DELETE ,
"KEY_DELETE" },
110 {css::awt::Key::ADD ,
"KEY_ADD" },
111 {css::awt::Key::SUBTRACT ,
"KEY_SUBTRACT" },
112 {css::awt::Key::MULTIPLY ,
"KEY_MULTIPLY" },
113 {css::awt::Key::DIVIDE ,
"KEY_DIVIDE" },
114 {css::awt::Key::POINT ,
"KEY_POINT" },
115 {css::awt::Key::COMMA ,
"KEY_COMMA" },
116 {css::awt::Key::LESS ,
"KEY_LESS" },
117 {css::awt::Key::GREATER ,
"KEY_GREATER" },
118 {css::awt::Key::EQUAL ,
"KEY_EQUAL" },
119 {css::awt::Key::OPEN ,
"KEY_OPEN" },
120 {css::awt::Key::CUT ,
"KEY_CUT" },
121 {css::awt::Key::COPY ,
"KEY_COPY" },
122 {css::awt::Key::PASTE ,
"KEY_PASTE" },
123 {css::awt::Key::UNDO ,
"KEY_UNDO" },
124 {css::awt::Key::REPEAT ,
"KEY_REPEAT" },
125 {css::awt::Key::FIND ,
"KEY_FIND" },
126 {css::awt::Key::PROPERTIES ,
"KEY_PROPERTIES" },
127 {css::awt::Key::FRONT ,
"KEY_FRONT" },
128 {css::awt::Key::CONTEXTMENU ,
"KEY_CONTEXTMENU"},
129 {css::awt::Key::HELP ,
"KEY_HELP" },
130 {css::awt::Key::MENU ,
"KEY_MENU" },
131 {css::awt::Key::HANGUL_HANJA ,
"KEY_HANGUL_HANJA"},
132 {css::awt::Key::DECIMAL ,
"KEY_DECIMAL" },
133 {css::awt::Key::TILDE ,
"KEY_TILDE" },
134 {css::awt::Key::QUOTELEFT ,
"KEY_QUOTELEFT" },
135 {css::awt::Key::BRACKETLEFT ,
"KEY_BRACKETLEFT" },
136 {css::awt::Key::BRACKETRIGHT ,
"KEY_BRACKETRIGHT" },
137 {css::awt::Key::SEMICOLON ,
"KEY_SEMICOLON" },
138 {css::awt::Key::QUOTERIGHT ,
"KEY_QUOTERIGHT" },
139 {css::awt::Key::RIGHTCURLYBRACKET,
"KEY_RIGHTCURLYBRACKET" },
140 {css::awt::Key::COLON ,
"KEY_COLON" },
172 sal_uInt16 nCode = 0;
174 throw css::lang::IllegalArgumentException(
175 "Can not map given identifier to a valid key code value.",
176 css::uno::Reference< css::uno::XInterface >(),
184 Code2IdentifierHash::const_iterator pIt =
m_lCodeHash.find(nCode);
189 return OUString::number(nCode);
198 rCode =
static_cast<sal_uInt16
>(nCode);
205 return sIdentifier ==
u"0";
can be used to map key identifier to the corresponding key codes ...
OUString mapCodeToIdentifier(sal_uInt16 nCode)
return a suitable key identifier for the specified key code.
static KeyMapping & get()
static KeyIdentifierInfo const KeyIdentifierMap[]
Identifier2CodeHash m_lIdentifierHash
hash to map identifier to key codes.
bool impl_st_interpretIdentifierAsPureKeyCode(std::u16string_view sIdentifier, sal_uInt16 &rCode)
check if the given string describe a numeric value ... and convert it.
sal_uInt16 mapIdentifierToCode(const OUString &sIdentifier)
return a suitable key code for the specified key identifier.
Code2IdentifierHash m_lCodeHash
hash to map key codes to identifier.
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)