MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / zep_key_from_rml

Function zep_key_from_rml

src/visualizer/gui/editor/python_editor.cpp:142–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 std::optional<uint32_t> zep_key_from_rml(const Rml::Input::KeyIdentifier key,
143 const uint32_t modifiers) {
144 switch (key) {
145 case Rml::Input::KI_RETURN:
146 case Rml::Input::KI_NUMPADENTER:
147 return Zep::ExtKeys::RETURN;
148 case Rml::Input::KI_BACK:
149 return Zep::ExtKeys::BACKSPACE;
150 case Rml::Input::KI_TAB:
151 return Zep::ExtKeys::TAB;
152 case Rml::Input::KI_ESCAPE:
153 return Zep::ExtKeys::ESCAPE;
154 case Rml::Input::KI_DELETE:
155 return Zep::ExtKeys::DEL;
156 case Rml::Input::KI_HOME:
157 return Zep::ExtKeys::HOME;
158 case Rml::Input::KI_END:
159 return Zep::ExtKeys::END;
160 case Rml::Input::KI_RIGHT:
161 return Zep::ExtKeys::RIGHT;
162 case Rml::Input::KI_LEFT:
163 return Zep::ExtKeys::LEFT;
164 case Rml::Input::KI_UP:
165 return Zep::ExtKeys::UP;
166 case Rml::Input::KI_DOWN:
167 return Zep::ExtKeys::DOWN;
168 case Rml::Input::KI_NEXT:
169 return Zep::ExtKeys::PAGEDOWN;
170 case Rml::Input::KI_PRIOR:
171 return Zep::ExtKeys::PAGEUP;
172 case Rml::Input::KI_INSERT:
173 return std::nullopt;
174 case Rml::Input::KI_F1:
175 case Rml::Input::KI_F2:
176 case Rml::Input::KI_F3:
177 case Rml::Input::KI_F4:
178 case Rml::Input::KI_F5:
179 case Rml::Input::KI_F6:
180 case Rml::Input::KI_F7:
181 case Rml::Input::KI_F8:
182 case Rml::Input::KI_F9:
183 case Rml::Input::KI_F10:
184 case Rml::Input::KI_F11:
185 case Rml::Input::KI_F12:
186 return Zep::ExtKeys::F1 + (static_cast<int>(key) - static_cast<int>(Rml::Input::KI_F1));
187 default:
188 break;
189 }
190
191 if ((modifiers & Zep::ModifierKey::Ctrl) == 0)
192 return std::nullopt;
193
194 if (key >= Rml::Input::KI_A && key <= Rml::Input::KI_Z)
195 return static_cast<uint32_t>('a' + (static_cast<int>(key) - static_cast<int>(Rml::Input::KI_A)));
196 if (key >= Rml::Input::KI_0 && key <= Rml::Input::KI_9)
197 return static_cast<uint32_t>('0' + (static_cast<int>(key) - static_cast<int>(Rml::Input::KI_0)));
198
199 switch (key) {

Callers 1

processRmlEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected