lib/fusuma/plugin/parsers/tap_parser.rb in fusuma-plugin-tap-0.2.0 vs lib/fusuma/plugin/parsers/tap_parser.rb in fusuma-plugin-tap-0.3.0
- old
+ new
@@ -92,15 +92,21 @@
2
when 'TAP_STATE_HOLD'
1
end
# KEEP
- when /\sgesture(| state):\s/, 'LIBINPUT TIMEOUT'
+ when 'LIBINPUT TIMEOUT', # Timeout Event
+ /\sgesture(| state):\s/ # 1.10.4 prints "gesture state: GESTURE_STATE_.*"
# NOTE: treat the "gesture(| state):" as KEEP
status = 'keep'
finger = 0
+ # MOVE
+ when /\sPOINTER_AXIS\s/, /\sPOINTER_MOTION\s/, /\sTAP_EVENT_PALM\s/
+ status = 'move'
+ finger = 0
+
# RELEASE
when /\stap(?:| state):\s.*(#{(STATE[:touches] | STATE[:holds]).join('|')}) → TAP_EVENT_RELEASE → (#{STATE[:releases].join('|')})/
status = 'release'
matched = Regexp.last_match
@@ -120,11 +126,11 @@
when /\stap(?:| state):\s.*(#{STATE[:releases].join('|')}) → TAP_EVENT_(.*) → #{STATE[:idle]}/
status = 'end'
matched = Regexp.last_match
finger = case matched[1]
- when 'TAP_STATE_DEAD'
- 4
+ when 'TAP_STATE_DEAD' # NOTE: 2 finger hold -> scroll become TAP_STATE_DEAD
+ 0
when 'TAP_STATE_TOUCH_3', 'TAP_STATE_TOUCH_3_HOLD'
3
when 'TAP_STATE_TOUCH_2', 'TAP_STATE_TOUCH_2_HOLD', 'TAP_STATE_TOUCH_2_RELEASE'
2
when 'TAP_STATE_TOUCH', 'TAP_STATE_HOLD', 'TAP_STATE_TAPPED'