Closed Ttibsi closed 1 year ago
An idea:
if (isMod(k) == rawterm::Mod::Control && k.code == 'q') {}
We can also add rawterm::Mod::None
isMod()
could look something vaguely like this and for multiple modifiers, loop through the results of isMod()
until it's equal to [None](rawterm::Mod::None)
(I'm not sure how to implement this, but another approach there is almost to treat None
in the same way std::string
using ::npos
)
rawterm::Mod isMod(Key k) { return (!(k.mod.empty()) ? k.mod.pop_back() : rawterm::Mod::None }
Currently I'm doing this to prevent segfaults if the mods list has any items in it:
Potential fix: Just make k.mod of type
rawterm::Mod
instead of a vector, as we never have multiple elements. Only time I can tell is if we doshift + alt + letter
, which currently isn't parsed anyway, but would be great if it was in the future) or potentially if we implement alt_gr in the future.