25 temp.Replace(
wxT(
"XCtrl+"),
wxT(
"Control+"));
30 temp.Replace(
wxT(
"RawCtrl+"),
wxT(
"Control+"));
31 temp.Replace(
wxT(
"Ctrl+"),
wxT(
"Command+"));
33 if (temp.Contains(
wxT(
"Control+"))) {
34 newkey +=
wxT(
"RawCtrl+");
37 if (temp.Contains(
wxT(
"Alt+")) || temp.Contains(
wxT(
"Option+"))) {
38 newkey +=
wxT(
"Alt+");
41 if (temp.Contains(
wxT(
"Shift+"))) {
42 newkey +=
wxT(
"Shift+");
45 if (temp.Contains(
wxT(
"Command+"))) {
46 newkey +=
wxT(
"Ctrl+");
50 newkey + temp.AfterLast(
wxT(
'+'));
58 (void)usesSpecialChars;
61 auto newkey = this->
GET();
64 if (!usesSpecialChars) {
66 newkey.Replace(
wxT(
"RawCtrl+"),
wxT(
"Control+"));
67 newkey.Replace(
wxT(
"Alt+"),
wxT(
"Option+"));
68 newkey.Replace(
wxT(
"Ctrl+"),
wxT(
"Command+"));
72 newkey.Replace(
wxT(
"Shift+"),
wxT(
"\u21e7"));
73 newkey.Replace(
wxT(
"RawCtrl+"),
'^');
74 newkey.Replace(
wxT(
"Alt+"),
wxT(
"\u2325"));
75 newkey.Replace(
wxT(
"Ctrl+"),
wxT(
"\u2318"));
87 long key =
event.GetKeyCode();
89 if (event.ControlDown())
90 newStr +=
wxT(
"Ctrl+");
93 newStr +=
wxT(
"Alt+");
95 if (event.ShiftDown())
96 newStr +=
wxT(
"Shift+");
99 if (event.RawControlDown())
100 newStr +=
wxT(
"RawCtrl+");
103 if (event.RawControlDown() &&
key >= 1 &&
key <= 26)
104 newStr += (wxChar)(64 +
key);
105 else if (
key >= 33 &&
key <= 255 &&
key != 127)
106 newStr += (wxChar)
key;
112 newStr +=
wxT(
"Backspace");
115 newStr +=
wxT(
"Delete");
118 newStr +=
wxT(
"Space");
121 newStr +=
wxT(
"Tab");
124 newStr +=
wxT(
"Return");
127 newStr +=
wxT(
"PageUp");
130 newStr +=
wxT(
"PageDown");
133 newStr +=
wxT(
"End");
136 newStr +=
wxT(
"Home");
139 newStr +=
wxT(
"Left");
145 newStr +=
wxT(
"Right");
148 newStr +=
wxT(
"Down");
151 newStr +=
wxT(
"Escape");
154 newStr +=
wxT(
"Insert");
157 newStr +=
wxT(
"NUMPAD0");
160 newStr +=
wxT(
"NUMPAD1");
163 newStr +=
wxT(
"NUMPAD2");
166 newStr +=
wxT(
"NUMPAD3");
169 newStr +=
wxT(
"NUMPAD4");
172 newStr +=
wxT(
"NUMPAD5");
175 newStr +=
wxT(
"NUMPAD6");
178 newStr +=
wxT(
"NUMPAD7");
181 newStr +=
wxT(
"NUMPAD8");
184 newStr +=
wxT(
"NUMPAD9");
229 newStr +=
wxT(
"F10");
232 newStr +=
wxT(
"F11");
235 newStr +=
wxT(
"F12");
238 newStr +=
wxT(
"F13");
241 newStr +=
wxT(
"F14");
244 newStr +=
wxT(
"F15");
247 newStr +=
wxT(
"F16");
250 newStr +=
wxT(
"F17");
253 newStr +=
wxT(
"F18");
256 newStr +=
wxT(
"F19");
259 newStr +=
wxT(
"F20");
262 newStr +=
wxT(
"F21");
265 newStr +=
wxT(
"F22");
268 newStr +=
wxT(
"F23");
271 newStr +=
wxT(
"F24");
273 case WXK_NUMPAD_ENTER:
274 newStr +=
wxT(
"NUMPAD_ENTER");
277 newStr +=
wxT(
"NUMPAD_F1");
280 newStr +=
wxT(
"NUMPAD_F2");
283 newStr +=
wxT(
"NUMPAD_F3");
286 newStr +=
wxT(
"NUMPAD_F4");
288 case WXK_NUMPAD_HOME:
289 newStr +=
wxT(
"NUMPAD_HOME");
291 case WXK_NUMPAD_LEFT:
292 newStr +=
wxT(
"NUMPAD_LEFT");
295 newStr +=
wxT(
"NUMPAD_UP");
297 case WXK_NUMPAD_RIGHT:
298 newStr +=
wxT(
"NUMPAD_RIGHT");
300 case WXK_NUMPAD_DOWN:
301 newStr +=
wxT(
"NUMPAD_DOWN");
303 case WXK_NUMPAD_PAGEUP:
304 newStr +=
wxT(
"NUMPAD_PAGEUP");
306 case WXK_NUMPAD_PAGEDOWN:
307 newStr +=
wxT(
"NUMPAD_PAGEDOWN");
310 newStr +=
wxT(
"NUMPAD_END");
312 case WXK_NUMPAD_BEGIN:
313 newStr +=
wxT(
"NUMPAD_HOME");
315 case WXK_NUMPAD_INSERT:
316 newStr +=
wxT(
"NUMPAD_INSERT");
318 case WXK_NUMPAD_DELETE:
319 newStr +=
wxT(
"NUMPAD_DELETE");
321 case WXK_NUMPAD_EQUAL:
322 newStr +=
wxT(
"NUMPAD_EQUAL");
324 case WXK_NUMPAD_MULTIPLY:
325 newStr +=
wxT(
"NUMPAD_MULTIPLY");
328 newStr +=
wxT(
"NUMPAD_ADD");
330 case WXK_NUMPAD_SUBTRACT:
331 newStr +=
wxT(
"NUMPAD_SUBTRACT");
333 case WXK_NUMPAD_DECIMAL:
334 newStr +=
wxT(
"NUMPAD_DECIMAL");
336 case WXK_NUMPAD_DIVIDE:
337 newStr +=
wxT(
"NUMPAD_DIVIDE");
static const AudacityProject::AttachedObjects::RegisteredFactory key
NormalizedKeyString KeyEventToKeyString(const wxKeyEvent &event)
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Template generates different TaggedIdentifier classes that don't interconvert implicitly.
wxString Display(bool usesSpecialChars=false) const
NormalizedKeyString()=default