MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / parse_keybinding_xkb

Function parse_keybinding_xkb

plugins/single_plugins/xkb-bindings.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65static std::optional<xkb_binding_t> parse_keybinding_xkb(std::string binding)
66{
67 binding.erase(std::remove(binding.begin(), binding.end(), ' '), binding.end());
68 auto tokens = tokenize_at(binding, '+');
69 if (tokens.empty())
70 {
71 return std::nullopt;
72 }
73
74 uint32_t mods = 0;
75 for (size_t i = 0; i < tokens.size() - 1; i++)
76 {
77 auto mod = parse_modifier(tokens[i]);
78 if (!mod)
79 {
80 return std::nullopt;
81 }
82
83 mods |= mod;
84 }
85
86 return xkb_binding_t{mods, tokens.back()};
87}
88
89class xkb_bindings_t : public wf::plugin_interface_t
90{

Callers 1

xkb_bindings_tClass · 0.85

Calls 6

tokenize_atFunction · 0.85
parse_modifierFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected