MCPcopy Create free account
hub / github.com/Bush2021/chrome_plus / ParseFunctionKey

Function ParseFunctionKey

src/utils.cc:345–361  ·  view source on GitHub ↗

Parse function key (F1-F24)

Source from the content-addressed store, hash-verified

343
344// Parse function key (F1-F24)
345std::optional<UINT> ParseFunctionKey(std::wstring_view key) {
346 if (key.size() < 2 || (key[0] != L'F' && key[0] != L'f'))
347 return std::nullopt;
348
349 auto num_part = key.substr(1);
350 if (num_part.empty() || !std::ranges::all_of(num_part, ::iswdigit))
351 return std::nullopt;
352
353 int fx = 0;
354 for (wchar_t c : num_part) {
355 fx = fx * 10 + (c - L'0');
356 }
357
358 if (fx >= 1 && fx <= 24)
359 return VK_F1 + fx - 1;
360 return std::nullopt;
361}
362
363// Parse single character key (A-Z, 0-9, symbols)
364std::optional<UINT> ParseCharacterKey(std::wstring_view key) {

Callers 1

ParseHotkeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected