parses the modifiers
This commit is contained in:
parent
1369b32df8
commit
9be4ad12e8
1 changed files with 4 additions and 2 deletions
|
@ -41,6 +41,7 @@ void OBBindings::display()
|
||||||
bool OBBindings::translate(const std::string &str, Binding &b)
|
bool OBBindings::translate(const std::string &str, Binding &b)
|
||||||
{
|
{
|
||||||
unsigned int mods = 0;
|
unsigned int mods = 0;
|
||||||
|
std::string modstring;
|
||||||
|
|
||||||
// parse out the base key name
|
// parse out the base key name
|
||||||
std::string::size_type keybegin = str.find_last_of('-');
|
std::string::size_type keybegin = str.find_last_of('-');
|
||||||
|
@ -54,6 +55,7 @@ bool OBBindings::translate(const std::string &str, Binding &b)
|
||||||
end = str.find_first_of('-', begin);
|
end = str.find_first_of('-', begin);
|
||||||
|
|
||||||
std::string mod(str, begin, end-begin);
|
std::string mod(str, begin, end-begin);
|
||||||
|
modstring += mod;
|
||||||
|
|
||||||
if (mod == "C") { // control
|
if (mod == "C") { // control
|
||||||
mods |= ControlMask;
|
mods |= ControlMask;
|
||||||
|
@ -78,11 +80,11 @@ bool OBBindings::translate(const std::string &str, Binding &b)
|
||||||
mod == "Mod5") {
|
mod == "Mod5") {
|
||||||
mods |= Mod5Mask;
|
mods |= Mod5Mask;
|
||||||
}
|
}
|
||||||
printf("got modifier: got modifier: %s\n", mod.c_str());
|
|
||||||
|
|
||||||
begin = end + 1;
|
begin = end + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("got modifier: %s\n", modstring.c_str());
|
||||||
|
|
||||||
KeySym sym = XStringToKeysym(const_cast<char *>(key.c_str()));
|
KeySym sym = XStringToKeysym(const_cast<char *>(key.c_str()));
|
||||||
if (sym == NoSymbol) return false;
|
if (sym == NoSymbol) return false;
|
||||||
b.modifiers = mods;
|
b.modifiers = mods;
|
||||||
|
|
Loading…
Reference in a new issue