fusuma-plugin-tap 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e02d886ca531aba36e5b71ed134b76062a72430a17a21f7a0a5a5941652c657f
4
- data.tar.gz: 8107fa9c300cd78028589198fe64ee4897bf5abbf3dc1621779102d0a3d66c58
3
+ metadata.gz: b8d626266cb1c6e86fce7c6e8f70d864dd705750299e0dce5e9c7ea30ddc27d2
4
+ data.tar.gz: f230dbefeaf8e249b7d05e880f55164841335580ae521f08e482cf0e91d64990
5
5
  SHA512:
6
- metadata.gz: 45f9c11102b3b6e530c647c9b8c7c9f10e5ea9820f5742cb858ea2dd2a014e5fbcb0b0ba37821d6c88268111c548a0276b0319a004ccd8ffeb64ca4e9eb31b3e
7
- data.tar.gz: 904e5c91e57005cf20000986621979b2da18abf171161b6b831a7ffb8432d4bed6e408352655107c9c8667ddc7aea9c5d545e48a147b900775325d3a3be361df
6
+ metadata.gz: cd656a66fcd871a8fcee663df9b37595f5c0f5beae784104e4fc3a3bf75e7d9192bafdda5c6229e94873a8efbec61fde6527426d20b0f93ac4e4691396eb8c9e
7
+ data.tar.gz: b29ba3b5929c037731d8f759e007436fa8db1f2b83b30e455a0ef8daa7658a8f8b367ac83513b6e20cd647def3257c0ea486e7c4768b11d2ee1f1cc21a80d075
data/.rubocop_todo.yml CHANGED
@@ -1,19 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-04-20 01:40:44 +0900 using RuboCop version 0.82.0.
3
+ # on 2020-05-04 22:12:29 +0900 using RuboCop version 0.82.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, Include.
12
- # Include: **/*.gemspec
13
- Gemspec/OrderedDependencies:
14
- Exclude:
15
- - 'fusuma-plugin-tap.gemspec'
16
-
17
9
  # Offense count: 1
18
10
  # Configuration parameters: Include.
19
11
  # Include: **/*.gemspec
@@ -35,7 +27,7 @@ Metrics/BlockLength:
35
27
  # Offense count: 1
36
28
  # Configuration parameters: IgnoredMethods.
37
29
  Metrics/CyclomaticComplexity:
38
- Max: 22
30
+ Max: 23
39
31
 
40
32
  # Offense count: 5
41
33
  # Configuration parameters: CountComments, ExcludedMethods.
@@ -45,7 +37,7 @@ Metrics/MethodLength:
45
37
  # Offense count: 1
46
38
  # Configuration parameters: IgnoredMethods.
47
39
  Metrics/PerceivedComplexity:
48
- Max: 10
40
+ Max: 11
49
41
 
50
42
  # Offense count: 1
51
43
  Style/Documentation:
@@ -53,3 +45,12 @@ Style/Documentation:
53
45
  - 'spec/**/*'
54
46
  - 'test/**/*'
55
47
  - 'bin/evemu_recorder.rb'
48
+
49
+ # Offense count: 2
50
+ # Cop supports --auto-correct.
51
+ # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
52
+ # SupportedStyles: predicate, comparison
53
+ Style/NumericPredicate:
54
+ Exclude:
55
+ - 'spec/**/*'
56
+ - 'lib/fusuma/plugin/detectors/tap_detector.rb'
data/.travis.yml CHANGED
@@ -5,8 +5,9 @@ cache: bundler
5
5
 
6
6
  env:
7
7
  matrix:
8
- - SPEC_LIBINPUT_VERSION=1.10.4
9
- - SPEC_LIBINPUT_VERSION=1.14.1
8
+ - LIBINPUT_VERSION=1.10.4
9
+ - LIBINPUT_VERSION=1.14.1
10
+ - LIBINPUT_VERSION=1.15.5
10
11
 
11
12
  cache:
12
13
  directories:
@@ -17,5 +18,6 @@ rvm:
17
18
  - 2.4
18
19
  - 2.5
19
20
  - 2.6
21
+ - 2.7
20
22
 
21
23
  before_install: gem install bundler --no-document -v 2.0.1
data/Makefile ADDED
@@ -0,0 +1,14 @@
1
+ .PHONY: all test clean
2
+
3
+ all: help
4
+
5
+ build: ## build libinput with LIBINPUT_VERSION
6
+ cd $(LIBINPUT_SOURCE_DIR) && \
7
+ git checkout $(LIBINPUT_VERSION) && \
8
+ meson --prefix=/usr builddir/ -Dlibwacom=false -Ddebug-gui=false -Dtests=false -Ddocumentation=false --reconfigure && \
9
+ ninja -C builddir/
10
+ $(LIBINPUT_LIST_DEVICES) --version
11
+
12
+ help: ## show help
13
+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | uniq | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
14
+
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.required_ruby_version = '>= 2.3' # https://packages.ubuntu.com/search?keywords=ruby&searchon=names&exact=1&suite=all&section=main
28
28
 
29
- spec.add_dependency 'fusuma', '~> 1.5'
29
+ spec.add_dependency 'fusuma', '~> 1.10'
30
30
 
31
31
  spec.add_development_dependency 'bundler'
32
32
  spec.add_development_dependency 'github_changelog_generator', '~> 1.14'
@@ -14,6 +14,11 @@ module Fusuma
14
14
  }
15
15
  end
16
16
 
17
+ # clear old events
18
+ def clear_expired(*)
19
+ clear if @events.any? { |e| ended?(e) }
20
+ end
21
+
17
22
  # @param event [Event]
18
23
  # @return [NilClass, TapBuffer]
19
24
  def buffer(event)
@@ -38,14 +43,14 @@ module Fusuma
38
43
  def bufferable?(event)
39
44
  case event.record.status
40
45
  when 'end'
41
- false
46
+ true
42
47
  when 'begin'
43
48
  if empty?
44
49
  true
45
50
  else
46
51
  false
47
52
  end
48
- else
53
+ else # 'keep', 'touch', 'hold', 'release'
49
54
  if empty?
50
55
  false
51
56
  else
@@ -69,7 +69,7 @@ module Fusuma
69
69
 
70
70
  def tap_released?(buffer)
71
71
  touch_num = buffer.events.count { |e| (e.record.status =~ /begin|touch/) }
72
- release_num = buffer.events.count { |e| e.record.status == 'release' }
72
+ release_num = buffer.events.count { |e| e.record.status =~ /release|end/ }
73
73
  MultiLogger.debug(touch_num: touch_num, release_num: release_num)
74
74
 
75
75
  case buffer.finger
@@ -80,7 +80,7 @@ module Fusuma
80
80
  when 3
81
81
  touch_num == release_num + 1
82
82
  when 4
83
- touch_num == release_num + 1
83
+ touch_num > 0 && release_num > 0
84
84
  else
85
85
  false
86
86
  end
@@ -54,13 +54,14 @@ module Fusuma
54
54
  gesture = 'tap'
55
55
 
56
56
  case record.to_s
57
- # BEGIN
57
+
58
+ # BEGIN
58
59
  when /\stap(?:| state):\s.*TAP_STATE_IDLE → TAP_EVENT_TOUCH → TAP_STATE_TOUCH/
59
60
  status = 'begin'
60
61
  finger = 1
61
62
 
62
- # TOUCH
63
- when /\stap(?:| state):\s.*(#{STATE[:touches].join('|')}) → TAP_EVENT_TOUCH → (#{STATE[:touches].join('|')})/
63
+ # TOUCH
64
+ when /\stap(?:| state):\s.*(#{STATE[:touches].join('|')}) → TAP_EVENT_(?:TOUCH|MOTION) → (#{STATE[:touches].join('|')})/
64
65
 
65
66
  status = 'touch'
66
67
 
@@ -93,7 +94,7 @@ module Fusuma
93
94
  1
94
95
  end
95
96
  # KEEP
96
- when /\sgesture(| state):\s/
97
+ when /\sgesture(| state):\s/, 'LIBINPUT TIMEOUT'
97
98
  # NOTE: treat the "gesture(| state):" as KEEP
98
99
  status = 'keep'
99
100
  finger = 0
@@ -121,6 +122,8 @@ module Fusuma
121
122
 
122
123
  matched = Regexp.last_match
123
124
  finger = case matched[1]
125
+ when 'TAP_STATE_DEAD'
126
+ 4
124
127
  when 'TAP_STATE_TOUCH_3', 'TAP_STATE_TOUCH_3_HOLD'
125
128
  3
126
129
  when 'TAP_STATE_TOUCH_2', 'TAP_STATE_TOUCH_2_HOLD', 'TAP_STATE_TOUCH_2_RELEASE'
@@ -3,7 +3,7 @@
3
3
  module Fusuma
4
4
  module Plugin
5
5
  module Tap
6
- VERSION = '0.1.3'
6
+ VERSION = '0.2.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusuma-plugin-tap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-20 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusuma
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '1.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +152,7 @@ files:
152
152
  - CODE_OF_CONDUCT.md
153
153
  - Gemfile
154
154
  - LICENSE.txt
155
+ - Makefile
155
156
  - README.md
156
157
  - Rakefile
157
158
  - bin/console