diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-10-14 05:03:15 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-10-14 05:03:15 +0000 |
| commit | 8ea3db574ad4fc3e8022d89045b66d4fe2597356 (patch) | |
| tree | 6a250bc3c761c2a656bdd0e011d37bf5a7be12ef /util/epist/parser.cc | |
| parent | 2037631f753753a5c1ee9b2475b55658c3bb6eea (diff) | |
more fixes, better sanity detection and error messages. it shouldn't hog the keyboard in any case now. it won't grab when modifiers or keys are borked.
Diffstat (limited to 'util/epist/parser.cc')
| -rw-r--r-- | util/epist/parser.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/util/epist/parser.cc b/util/epist/parser.cc index 00be5d7e..5c953aae 100644 --- a/util/epist/parser.cc +++ b/util/epist/parser.cc @@ -61,6 +61,18 @@ void parser::parse(string rc_file) _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 { @@ -189,14 +201,11 @@ void parser::endChain() 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() |
