fusuma-plugin-touchscreen 0.0.1.alpha

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.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +2 -0
  4. data/fusuma-plugin-touchscreen.gemspec +28 -0
  5. data/lib/fusuma/plugin/buffers/touch_buffer.rb +197 -0
  6. data/lib/fusuma/plugin/detectors/touch_detector.rb +95 -0
  7. data/lib/fusuma/plugin/detectors/touch_detectors/base.rb +17 -0
  8. data/lib/fusuma/plugin/detectors/touch_detectors/edge_detector.rb +13 -0
  9. data/lib/fusuma/plugin/detectors/touch_detectors/hold_detector.rb +26 -0
  10. data/lib/fusuma/plugin/detectors/touch_detectors/pinch_detector.rb +13 -0
  11. data/lib/fusuma/plugin/detectors/touch_detectors/rotate_detector.rb +13 -0
  12. data/lib/fusuma/plugin/detectors/touch_detectors/swipe_detector.rb +59 -0
  13. data/lib/fusuma/plugin/detectors/touch_detectors/tap_detector.rb +32 -0
  14. data/lib/fusuma/plugin/devices/touchscreen_device.rb +21 -0
  15. data/lib/fusuma/plugin/events/records/touch_record.rb +38 -0
  16. data/lib/fusuma/plugin/events/records/touch_records/base.rb +56 -0
  17. data/lib/fusuma/plugin/events/records/touch_records/hold_record.rb +21 -0
  18. data/lib/fusuma/plugin/events/records/touch_records/swipe_record.rb +33 -0
  19. data/lib/fusuma/plugin/events/records/touch_records/tap_record.rb +21 -0
  20. data/lib/fusuma/plugin/parsers/touch_parser.rb +103 -0
  21. data/lib/fusuma/plugin/touchscreen/version.rb +9 -0
  22. data/lib/fusuma/plugin/touchscreen.rb +11 -0
  23. data/lib/fusuma/utils/angle.rb +12 -0
  24. data/spec/fixtures/libinput-list-devices_ms-surface-3-pro.txt +182 -0
  25. data/spec/fusuma/plugin/devices/touchscreen_device_spec.rb +33 -0
  26. data/spec/fusuma/plugin/parsers/touch_parser_spec.rb +26 -0
  27. data/spec/samples/1-finger-hold.txt +90 -0
  28. data/spec/samples/2-fingers-swipe-right.txt +46 -0
  29. data/spec/samples/3-fingers-tap.txt +9 -0
  30. data/spec/samples/libinput-devices.txt +182 -0
  31. data/spec/spec_helper.rb +101 -0
  32. metadata +96 -0
@@ -0,0 +1,182 @@
1
+ Device: Video Bus
2
+ Kernel: /dev/input/event7
3
+ Group: 1
4
+ Seat: seat0, default
5
+ Capabilities: keyboard
6
+ Tap-to-click: n/a
7
+ Tap-and-drag: n/a
8
+ Tap drag lock: n/a
9
+ Left-handed: n/a
10
+ Nat.scrolling: n/a
11
+ Middle emulation: n/a
12
+ Calibration: n/a
13
+ Scroll methods: none
14
+ Click methods: none
15
+ Disable-w-typing: n/a
16
+ Accel profiles: n/a
17
+ Rotation: n/a
18
+
19
+ Device: Surface Pro 3/4 Buttons
20
+ Kernel: /dev/input/event14
21
+ Group: 2
22
+ Seat: seat0, default
23
+ Capabilities: keyboard
24
+ Tap-to-click: n/a
25
+ Tap-and-drag: n/a
26
+ Tap drag lock: n/a
27
+ Left-handed: n/a
28
+ Nat.scrolling: n/a
29
+ Middle emulation: n/a
30
+ Calibration: n/a
31
+ Scroll methods: none
32
+ Click methods: none
33
+ Disable-w-typing: n/a
34
+ Accel profiles: n/a
35
+ Rotation: n/a
36
+
37
+ Device: Lid Switch
38
+ Kernel: /dev/input/event0
39
+ Group: 3
40
+ Seat: seat0, default
41
+ Capabilities: switch
42
+ Tap-to-click: n/a
43
+ Tap-and-drag: n/a
44
+ Tap drag lock: n/a
45
+ Left-handed: n/a
46
+ Nat.scrolling: n/a
47
+ Middle emulation: n/a
48
+ Calibration: n/a
49
+ Scroll methods: none
50
+ Click methods: none
51
+ Disable-w-typing: n/a
52
+ Accel profiles: n/a
53
+ Rotation: n/a
54
+
55
+ Device: Microsoft Surface Type Cover Keyboard
56
+ Kernel: /dev/input/event13
57
+ Group: 4
58
+ Seat: seat0, default
59
+ Capabilities: keyboard pointer
60
+ Tap-to-click: n/a
61
+ Tap-and-drag: n/a
62
+ Tap drag lock: n/a
63
+ Left-handed: n/a
64
+ Nat.scrolling: disabled
65
+ Middle emulation: n/a
66
+ Calibration: n/a
67
+ Scroll methods: none
68
+ Click methods: none
69
+ Disable-w-typing: n/a
70
+ Accel profiles: n/a
71
+ Rotation: n/a
72
+
73
+ Device: Microsoft Surface Type Cover Mouse
74
+ Kernel: /dev/input/event15
75
+ Group: 4
76
+ Seat: seat0, default
77
+ Capabilities: pointer
78
+ Tap-to-click: n/a
79
+ Tap-and-drag: n/a
80
+ Tap drag lock: n/a
81
+ Left-handed: disabled
82
+ Nat.scrolling: disabled
83
+ Middle emulation: disabled
84
+ Calibration: n/a
85
+ Scroll methods: button
86
+ Click methods: none
87
+ Disable-w-typing: n/a
88
+ Accel profiles: flat *adaptive
89
+ Rotation: n/a
90
+
91
+ Device: Microsoft Surface Type Cover Touchpad
92
+ Kernel: /dev/input/event17
93
+ Group: 4
94
+ Seat: seat0, default
95
+ Size: 98x50mm
96
+ Capabilities: pointer gesture
97
+ Tap-to-click: disabled
98
+ Tap-and-drag: enabled
99
+ Tap drag lock: disabled
100
+ Left-handed: disabled
101
+ Nat.scrolling: disabled
102
+ Middle emulation: disabled
103
+ Calibration: n/a
104
+ Scroll methods: *two-finger edge
105
+ Click methods: *button-areas clickfinger
106
+ Disable-w-typing: enabled
107
+ Accel profiles: flat *adaptive
108
+ Rotation: n/a
109
+
110
+ Device: Microsoft LifeCam Front: Micros
111
+ Kernel: /dev/input/event1
112
+ Group: 5
113
+ Seat: seat0, default
114
+ Capabilities: keyboard
115
+ Tap-to-click: n/a
116
+ Tap-and-drag: n/a
117
+ Tap drag lock: n/a
118
+ Left-handed: n/a
119
+ Nat.scrolling: n/a
120
+ Middle emulation: n/a
121
+ Calibration: n/a
122
+ Scroll methods: none
123
+ Click methods: none
124
+ Disable-w-typing: n/a
125
+ Accel profiles: n/a
126
+ Rotation: n/a
127
+
128
+ Device: Microsoft LifeCam Rear: Microso
129
+ Kernel: /dev/input/event2
130
+ Group: 6
131
+ Seat: seat0, default
132
+ Capabilities: keyboard
133
+ Tap-to-click: n/a
134
+ Tap-and-drag: n/a
135
+ Tap drag lock: n/a
136
+ Left-handed: n/a
137
+ Nat.scrolling: n/a
138
+ Middle emulation: n/a
139
+ Calibration: n/a
140
+ Scroll methods: none
141
+ Click methods: none
142
+ Disable-w-typing: n/a
143
+ Accel profiles: n/a
144
+ Rotation: n/a
145
+
146
+ Device: NTRG0001:01 1B96:1B05 Stylus
147
+ Kernel: /dev/input/event3
148
+ Group: 7
149
+ Seat: seat0, default
150
+ Size: 253x167mm
151
+ Capabilities: tablet
152
+ Tap-to-click: n/a
153
+ Tap-and-drag: n/a
154
+ Tap drag lock: n/a
155
+ Left-handed: n/a
156
+ Nat.scrolling: n/a
157
+ Middle emulation: n/a
158
+ Calibration: identity matrix
159
+ Scroll methods: none
160
+ Click methods: none
161
+ Disable-w-typing: n/a
162
+ Accel profiles: none
163
+ Rotation: n/a
164
+
165
+ Device: NTRG0001:01 1B96:1B05
166
+ Kernel: /dev/input/event4
167
+ Group: 7
168
+ Seat: seat0, default
169
+ Size: 253x167mm
170
+ Capabilities: touch
171
+ Tap-to-click: n/a
172
+ Tap-and-drag: n/a
173
+ Tap drag lock: n/a
174
+ Left-handed: n/a
175
+ Nat.scrolling: n/a
176
+ Middle emulation: n/a
177
+ Calibration: identity matrix
178
+ Scroll methods: none
179
+ Click methods: none
180
+ Disable-w-typing: n/a
181
+ Accel profiles: n/a
182
+ Rotation: n/a
@@ -0,0 +1,101 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+
17
+ require 'fusuma'
18
+
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
44
+ # have no way to turn it off -- the option exists only for backwards
45
+ # compatibility in RSpec 3). It causes shared context metadata to be
46
+ # inherited by the metadata hash of host groups and examples, rather than
47
+ # triggering implicit auto-inclusion in groups with matching metadata.
48
+ config.shared_context_metadata_behavior = :apply_to_host_groups
49
+
50
+ # The settings below are suggested to provide a good initial experience
51
+ # with RSpec, but feel free to customize to your heart's content.
52
+ =begin
53
+ # This allows you to limit a spec run to individual examples or groups
54
+ # you care about by tagging them with `:focus` metadata. When nothing
55
+ # is tagged with `:focus`, all examples get run. RSpec also provides
56
+ # aliases for `it`, `describe`, and `context` that include `:focus`
57
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
58
+ config.filter_run_when_matching :focus
59
+
60
+ # Allows RSpec to persist some state between runs in order to support
61
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
62
+ # you configure your source control system to ignore this file.
63
+ config.example_status_persistence_file_path = "spec/examples.txt"
64
+
65
+ # Limits the available syntax to the non-monkey patched syntax that is
66
+ # recommended. For more details, see:
67
+ # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
68
+ config.disable_monkey_patching!
69
+
70
+ # This setting enables warnings. It's recommended, but in some cases may
71
+ # be too noisy due to issues in dependencies.
72
+ config.warnings = true
73
+
74
+ # Many RSpec users commonly either run the entire suite or an individual
75
+ # file, and it's useful to allow more verbose output when running an
76
+ # individual spec file.
77
+ if config.files_to_run.one?
78
+ # Use the documentation formatter for detailed output,
79
+ # unless a formatter has already been configured
80
+ # (e.g. via a command-line flag).
81
+ config.default_formatter = "doc"
82
+ end
83
+
84
+ # Print the 10 slowest examples and example groups at the
85
+ # end of the spec run, to help surface which specs are running
86
+ # particularly slow.
87
+ config.profile_examples = 10
88
+
89
+ # Run specs in random order to surface order dependencies. If you find an
90
+ # order dependency and want to debug it, you can fix the order by providing
91
+ # the seed, which is printed after each run.
92
+ # --seed 1234
93
+ config.order = :random
94
+
95
+ # Seed global randomization in this process using the `--seed` CLI option.
96
+ # Setting this allows you to use `--seed` to deterministically reproduce
97
+ # test failures related to randomization by passing the same `--seed` value
98
+ # as the one that triggered the failure.
99
+ Kernel.srand config.seed
100
+ =end
101
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fusuma-plugin-touchscreen
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.alpha
5
+ platform: ruby
6
+ authors:
7
+ - Mikhail Fedotov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-06-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fusuma
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ description: " fusuma-plugin-touchscreen is Fusuma plugin for support touchscreen
28
+ devices. "
29
+ email:
30
+ - myf.ivm@gmail.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - LICENSE
36
+ - README.md
37
+ - fusuma-plugin-touchscreen.gemspec
38
+ - lib/fusuma/plugin/buffers/touch_buffer.rb
39
+ - lib/fusuma/plugin/detectors/touch_detector.rb
40
+ - lib/fusuma/plugin/detectors/touch_detectors/base.rb
41
+ - lib/fusuma/plugin/detectors/touch_detectors/edge_detector.rb
42
+ - lib/fusuma/plugin/detectors/touch_detectors/hold_detector.rb
43
+ - lib/fusuma/plugin/detectors/touch_detectors/pinch_detector.rb
44
+ - lib/fusuma/plugin/detectors/touch_detectors/rotate_detector.rb
45
+ - lib/fusuma/plugin/detectors/touch_detectors/swipe_detector.rb
46
+ - lib/fusuma/plugin/detectors/touch_detectors/tap_detector.rb
47
+ - lib/fusuma/plugin/devices/touchscreen_device.rb
48
+ - lib/fusuma/plugin/events/records/touch_record.rb
49
+ - lib/fusuma/plugin/events/records/touch_records/base.rb
50
+ - lib/fusuma/plugin/events/records/touch_records/hold_record.rb
51
+ - lib/fusuma/plugin/events/records/touch_records/swipe_record.rb
52
+ - lib/fusuma/plugin/events/records/touch_records/tap_record.rb
53
+ - lib/fusuma/plugin/parsers/touch_parser.rb
54
+ - lib/fusuma/plugin/touchscreen.rb
55
+ - lib/fusuma/plugin/touchscreen/version.rb
56
+ - lib/fusuma/utils/angle.rb
57
+ - spec/fixtures/libinput-list-devices_ms-surface-3-pro.txt
58
+ - spec/fusuma/plugin/devices/touchscreen_device_spec.rb
59
+ - spec/fusuma/plugin/parsers/touch_parser_spec.rb
60
+ - spec/samples/1-finger-hold.txt
61
+ - spec/samples/2-fingers-swipe-right.txt
62
+ - spec/samples/3-fingers-tap.txt
63
+ - spec/samples/libinput-devices.txt
64
+ - spec/spec_helper.rb
65
+ homepage: https://github.com/Phaengris/fusuma-plugin-touchscreen
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '2.3'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.3.1
83
+ requirements: []
84
+ rubygems_version: 3.3.7
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Touchscreen support plugin for Fusuma
88
+ test_files:
89
+ - spec/fixtures/libinput-list-devices_ms-surface-3-pro.txt
90
+ - spec/fusuma/plugin/devices/touchscreen_device_spec.rb
91
+ - spec/fusuma/plugin/parsers/touch_parser_spec.rb
92
+ - spec/samples/1-finger-hold.txt
93
+ - spec/samples/2-fingers-swipe-right.txt
94
+ - spec/samples/3-fingers-tap.txt
95
+ - spec/samples/libinput-devices.txt
96
+ - spec/spec_helper.rb