X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6e5762dc8d5995342e03e4b74722d6ddff85af0e..4cedb788563967100c39c2764be5b9daefc15d1a:/lib/actions/action.cpp diff --git a/lib/actions/action.cpp b/lib/actions/action.cpp index f0debf2c..0eb4cdb1 100644 --- a/lib/actions/action.cpp +++ b/lib/actions/action.cpp @@ -2,6 +2,7 @@ #include #include #include +#include /* @@ -87,7 +88,7 @@ void eActionMap::unbindAction(const std::string &context, ePyObject function) } -void eActionMap::bindKey(const std::string &device, int key, int flags, const std::string &context, const std::string &action) +void eActionMap::bindKey(const std::string &domain, const std::string &device, int key, int flags, const std::string &context, const std::string &action) { // first, search the actionlist table unsigned int i; @@ -101,6 +102,7 @@ void eActionMap::bindKey(const std::string &device, int key, int flags, const st bind.m_key = key; bind.m_flags = flags; bind.m_action = actions[i].m_id; + bind.m_domain = domain; m_native_keys.insert(std::pair(context, bind)); return; } @@ -113,9 +115,27 @@ void eActionMap::bindKey(const std::string &device, int key, int flags, const st bind.m_key = key; bind.m_flags = flags; bind.m_action = action; + bind.m_domain = domain; m_python_keys.insert(std::pair(context, bind)); } +void eActionMap::unbindKeyDomain(const std::string &domain) +{ + for (std::multimap::iterator i(m_native_keys.begin()); i != m_native_keys.end(); ++i) + if (i->second.m_domain == domain) + { + m_native_keys.erase(i); + i = m_native_keys.begin(); + } + + for (std::multimap::iterator i(m_python_keys.begin()); i != m_python_keys.end(); ++i) + if (i->second.m_domain == domain) + { + m_python_keys.erase(i); + i = m_python_keys.begin(); + } +} + struct call_entry { ePyObject m_fnc, m_arg; @@ -130,9 +150,14 @@ void eActionMap::keyPressed(const std::string &device, int key, int flags) std::list call_list; /* iterate active contexts. */ - for (std::multimap::const_iterator c(m_bindings.begin()); + for (std::multimap::iterator c(m_bindings.begin()); c != m_bindings.end(); ++c) { + if (flags == eRCKey::flagMake) + c->second.m_prev_seen_make_key = key; + else if (c->second.m_prev_seen_make_key != key) // ignore repeat or break when the make code for this key was not visible + continue; + /* is this a native context? */ if (c->second.m_widget) {