From e97cb2c6c3709569bf7a6f933cfd3da7057c4495 Mon Sep 17 00:00:00 2001 From: June Tate-Gans Date: Sun, 25 Apr 2021 23:16:03 -0500 Subject: [PATCH] stick: Fix a logic error I introduced Late night hacking causes all kinds of silliness. We only want to stop running an action when the key is not pressed now, but was prior pressed. My logic caused it to fire when not pressed and not prior pressed, erroneously, leading to stuck keys. --- g13d/stick.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/g13d/stick.cc b/g13d/stick.cc index 9503ff3..4ba8f2f 100644 --- a/g13d/stick.cc +++ b/g13d/stick.cc @@ -97,8 +97,10 @@ void StickZone::test(const ZoneCoord &loc) { bool prior_active = _active; _active = _bounds.contains(loc); - if ((!_active) && prior_active) { - _action->act(false); + if (!_active) { + if (prior_active) { + _action->act(false); + } } else { _action->act(true); }