ignore break or repeat when the make code for this key was not visible
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 12 Jul 2007 14:44:34 +0000 (14:44 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 12 Jul 2007 14:44:34 +0000 (14:44 +0000)
lib/actions/action.cpp
lib/actions/action.h

index cb9e5e0..0eb4cdb 100644 (file)
@@ -2,6 +2,7 @@
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
 #include <lib/actions/actionids.h>
+#include <lib/driver/rc.h>
 
 /*
 
@@ -149,9 +150,14 @@ void eActionMap::keyPressed(const std::string &device, int key, int flags)
        std::list<call_entry> call_list;
        
                /* iterate active contexts. */
-       for (std::multimap<int,eActionBinding>::const_iterator c(m_bindings.begin());
+       for (std::multimap<int,eActionBinding>::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)
                {
index f0a6ee4..9628a69 100644 (file)
@@ -43,6 +43,9 @@ private:
        static eActionMap *instance;
        struct eActionBinding
        {
+               eActionBinding()
+                       :m_prev_seen_make_key(-1)
+               {}
 //             eActionContext *m_context;
                std::string m_context; // FIXME
                std::string m_domain;
@@ -51,6 +54,7 @@ private:
                
                eWidget *m_widget;
                int m_id;
+               int m_prev_seen_make_key;
        };
        
        std::multimap<int, eActionBinding> m_bindings;