X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fbinarycontrol.cpp;h=09efe40ac74f32500660030088b389076fdc5409;hb=7302a061c57602203895b616bf54d96269c677c6;hp=70a816570fb2d33bcc697ec52fe1fe770cd19147;hpb=c9626e6953c16efc66575eff80c4c0de2f739041;p=libs%2Fgui.git diff --git a/source/input/binarycontrol.cpp b/source/input/binarycontrol.cpp index 70a8165..09efe40 100644 --- a/source/input/binarycontrol.cpp +++ b/source/input/binarycontrol.cpp @@ -21,16 +21,20 @@ BinaryControl::BinaryControl(Device &d, ControlSrcType t, unsigned i): threshold(0.5) { } +BinaryControl::~BinaryControl() +{ } + void BinaryControl::set_threshold(float t) { - threshold=t; + threshold = t; } void BinaryControl::on_press() { if(!state) { - state=true; + state = true; + rising_edge = true; signal_press.emit(); } } @@ -39,7 +43,8 @@ void BinaryControl::on_release() { if(state) { - state=false; + state = false; + falling_edge = true; signal_release.emit(); } }