]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/control.h
Keep track of edges in Control
[libs/gui.git] / source / input / control.h
index 450b057ce30496b27f20ec251d3310163c45ae72..7a4fd0e0a4ddbf6bd384b317f35e475b9719d6f9 100644 (file)
@@ -58,6 +58,8 @@ protected:
        Device *capture_dev;
        BinaryControl *activator;
        float origin;
+       bool rising_edge;
+       bool falling_edge;
 
        Control();
        Control(const ControlSource &);
@@ -72,6 +74,9 @@ public:
        const ControlSource &get_source() const { return src; }
        void set_activator(BinaryControl *);
        BinaryControl *get_activator() const { return activator; }
+       bool has_rising_edge() const { return rising_edge; }
+       bool has_falling_edge() const { return falling_edge; }
+       void reset_edges();
 protected:
        virtual void on_press() = 0;
        virtual void on_release() = 0;