lib/fusuma/plugin/detectors/tap_detector.rb in fusuma-plugin-tap-0.1.3 vs lib/fusuma/plugin/detectors/tap_detector.rb in fusuma-plugin-tap-0.2.0
- old
+ new
@@ -67,21 +67,21 @@
tap_released?(buffer)
end
def tap_released?(buffer)
touch_num = buffer.events.count { |e| (e.record.status =~ /begin|touch/) }
- release_num = buffer.events.count { |e| e.record.status == 'release' }
+ release_num = buffer.events.count { |e| e.record.status =~ /release|end/ }
MultiLogger.debug(touch_num: touch_num, release_num: release_num)
case buffer.finger
when 1
touch_num == release_num
when 2
touch_num == release_num + 1
when 3
touch_num == release_num + 1
when 4
- touch_num == release_num + 1
+ touch_num > 0 && release_num > 0
else
false
end
end