4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "InputKeys.hpp"
25 #include "Screen/Key.h"
26 #include "Util/CharUtil.hpp"
30 struct string_to_key
{
35 static constexpr struct string_to_key string_to_key
[] = {
36 { _T("APP1"), KEY_APP1
},
37 { _T("APP2"), KEY_APP2
},
38 { _T("APP3"), KEY_APP3
},
39 { _T("APP4"), KEY_APP4
},
40 { _T("APP5"), KEY_APP5
},
41 { _T("APP6"), KEY_APP6
},
51 { _T("F10"), KEY_F10
},
52 { _T("F11"), KEY_F11
},
53 { _T("F12"), KEY_F12
},
55 /* These Keys are used for the Triadis-RemoteStick, as well as for
56 expanded Keyboard-Events */
57 { _T("F13"), KEY_F13
},
58 { _T("F14"), KEY_F14
},
59 { _T("F15"), KEY_F15
},
60 { _T("F16"), KEY_F16
},
61 { _T("F17"), KEY_F17
},
62 { _T("F18"), KEY_F18
},
63 { _T("F19"), KEY_F19
},
64 { _T("F20"), KEY_F20
},
66 { _T("LEFT"), KEY_LEFT
},
67 { _T("RIGHT"), KEY_RIGHT
},
69 { _T("DOWN"), KEY_DOWN
},
70 { _T("RETURN"), KEY_RETURN
},
71 { _T("ESCAPE"), KEY_ESCAPE
},
72 { _T("MENU"), KEY_MENU
},
77 ParseKeyCode(const TCHAR
*data
)
79 for (const struct string_to_key
*p
= &string_to_key
[0]; p
->name
!= NULL
; ++p
)
80 if (_tcscmp(data
, p
->name
) == 0)
83 if (_tcslen(data
) == 1)
84 return ToUpperASCII(data
[0]);