switch-controller: modify sw behaviour
This commit is contained in:
parent
59486a746a
commit
94518925f8
@ -24,17 +24,15 @@ SwitchController::~SwitchController ()
|
|||||||
void
|
void
|
||||||
SwitchController::listen ()
|
SwitchController::listen ()
|
||||||
{
|
{
|
||||||
/** Button is pressed for the first time*/
|
/** Button is pressed for the first time */
|
||||||
if (b->read () && !b_pressed)
|
if (b->read () && !b_pressed)
|
||||||
{
|
{
|
||||||
|
h->HandleState (Event (Event::eKey, b_mode));
|
||||||
b_pressed = true;
|
b_pressed = true;
|
||||||
}
|
}
|
||||||
/** Button is released before 2 seconds*/
|
/** Button is released */
|
||||||
if (!b->read () && b_pressed)
|
if (!b->read () && b_pressed)
|
||||||
{
|
{
|
||||||
h->HandleState (Event (Event::eKey, b_mode));
|
|
||||||
b_pressed = false;
|
b_pressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user