}
KeySym sym = XStringToKeysym(key.c_str());
-
- if (sym == 0) {
- std::cerr << "Key " << key << " is invalid! (Action ignored)\n";
- return;
- }
-
keynode *tmp = new keynode;
+
tmp->action = new Action(action,
XKeysymToKeycode(_display, sym),
mask, arg);
{
if (_current->action)
delete _current->action;
-
+
+ KeySym sym = XStringToKeysym(key.c_str());
_current->action = new Action(action,
- XKeysymToKeycode(_display,
- XStringToKeysym(key.c_str())),
+ XKeysymToKeycode(_display, sym),
mask, arg);
}
_kt->initialize();
}
+void parser::setKey(string key)
+{
+ KeySym sym = XStringToKeysym(key.c_str());
+
+ if (sym == 0) {
+ std::cerr << "ERROR: Invalid key (" << key << ")! This may cause odd behavior.\n";
+ _add = false;
+ } else {
+ _key = key;
+ }
+}
+
void parser::setAction(string act)
{
struct {
void parser::setChainBinding()
{
- if (_mask != 0 && _key != "") {
- if (!_add) {
- cout << "Error: Bad modifier detected on chain's root key.\n";
- _add = true;
- }
+ if (_add)
_kt->setCurrentNodeProps(Action::noaction, _mask, _key, "");
- reset();
- }
+
+ _add = true;
+ reset();
}
void parser::reset()
void parse(std::string);
- void setKey(std::string key)
- { _key = key; }
-
void setArgumentNum(std::string arg)
{ _arg = arg; }
void setOption(std::string opt)
{ _config->addOption(opt, _arg); }
+ void setKey(std::string);
void setAction(std::string);
void addModifier(std::string);
void endAction();