lib/fusuma/plugin/buffers/tap_buffer.rb in fusuma-plugin-tap-0.2.0 vs lib/fusuma/plugin/buffers/tap_buffer.rb in fusuma-plugin-tap-0.3.0
- old
+ new
@@ -20,11 +20,11 @@
end
# @param event [Event]
# @return [NilClass, TapBuffer]
def buffer(event)
- return if event&.tag != source
+ return unless (event&.tag == source) || (event&.tag == 'libinput_gesture_parser')
# NOTE: need to set `begin` event at first of buffer
clear && return unless bufferable?(event)
@events.push(event)
@@ -48,15 +48,23 @@
if empty?
true
else
false
end
- else # 'keep', 'touch', 'hold', 'release'
+ when 'keep', 'touch', 'hold', 'release', 'move'
if empty?
false
else
true
end
+ when 'update' # libinput_gesture_parser
+ if empty?
+ false
+ else
+ true
+ end
+ else
+ raise "Unexpected status: #{event.record.status}"
end
end
def present?
!empty?