fusuma 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/exe/fusuma +5 -0
- data/lib/fusuma/multi_logger.rb +14 -2
- data/lib/fusuma/plugin/detectors/pinch_detector.rb +9 -2
- data/lib/fusuma/plugin/detectors/rotate_detector.rb +8 -2
- data/lib/fusuma/plugin/detectors/swipe_detector.rb +11 -3
- data/lib/fusuma/version.rb +1 -1
- data/lib/fusuma.rb +1 -0
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c964784d9707a4ca667c19b4c866bd5e0abc8e61e2f0752903c2cac3fd064448
|
4
|
+
data.tar.gz: fc9c42d27ee80535d6da10f3cdd0ee707a128ad42f147366dd40f4c2053a273a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99e47419a912ae9e77215fef51bae8bc6a657ac679dbb9a55873087753f354bc9b077657f2fa7699372931ac7a0d0f3faef7d732da4197e1fcef2623b02b8b9c
|
7
|
+
data.tar.gz: 7d8ac348be34c4756e549ac0856fa01119680d5d9ebc7346ca3dc29070023b3a6c8d6a4f2218a3fde6951936d51d8ea0335723dcf2a76285f5ab7a477746ca4e
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Fusuma [![Gem Version](https://badge.fury.io/rb/fusuma.svg)](https://badge.fury.io/rb/fusuma) [![Build Status](https://travis-ci.com/iberianpig/fusuma.svg?branch=master)](https://travis-ci.com/iberianpig/fusuma) [![Coverage Status](https://coveralls.io/repos/github/iberianpig/fusuma/badge.svg?branch=master)](https://coveralls.io/github/iberianpig/fusuma?branch=master)
|
1
|
+
# Fusuma [![Gem Version](https://badge.fury.io/rb/fusuma.svg)](https://badge.fury.io/rb/fusuma) [![Build Status](https://travis-ci.com/iberianpig/fusuma.svg?branch=master)](https://travis-ci.com/iberianpig/fusuma) [![Coverage Status](https://coveralls.io/repos/github/iberianpig/fusuma/badge.svg?branch=master)](https://coveralls.io/github/iberianpig/fusuma?branch=master)
|
2
2
|
|
3
3
|
Fusuma is multitouch gesture recognizer.
|
4
4
|
This gem makes your linux able to recognize swipes or pinchs and assign commands to them.
|
@@ -298,6 +298,7 @@ swipe:
|
|
298
298
|
- `-l`, `--list-devices` : List available devices
|
299
299
|
- `-v`, `--verbose` : Show details about the results of running fusuma
|
300
300
|
- `--version` : Show fusuma version
|
301
|
+
- `--log-file=path/to/file` : Set path of log file
|
301
302
|
|
302
303
|
### Specify touchpads by device name
|
303
304
|
Set the following options to recognize multi-touch gestures only for the specified touchpad device.
|
data/exe/fusuma
CHANGED
@@ -22,6 +22,11 @@ opt.on('-l', '--list-devices',
|
|
22
22
|
option[:list] = v
|
23
23
|
end
|
24
24
|
|
25
|
+
opt.on('--log=path/to/file',
|
26
|
+
'Print logs to file') do |v|
|
27
|
+
option[:log_filepath] = v
|
28
|
+
end
|
29
|
+
|
25
30
|
opt.on('--device="Device name"',
|
26
31
|
'Open the given device only (DEPRECATED)') do |v|
|
27
32
|
option[:device] = v
|
data/lib/fusuma/multi_logger.rb
CHANGED
@@ -11,9 +11,21 @@ module Fusuma
|
|
11
11
|
attr_reader :err_logger
|
12
12
|
attr_accessor :debug_mode
|
13
13
|
|
14
|
+
@@filepath = nil
|
15
|
+
def self.filepath=(filepath)
|
16
|
+
@@filepath = filepath
|
17
|
+
end
|
18
|
+
|
14
19
|
def initialize
|
15
|
-
|
16
|
-
|
20
|
+
if @@filepath
|
21
|
+
logfile = File.new(@@filepath, 'a')
|
22
|
+
super(logfile)
|
23
|
+
$stderr = logfile
|
24
|
+
@err_logger = Logger.new($stderr)
|
25
|
+
else
|
26
|
+
super($stdout)
|
27
|
+
@err_logger = Logger.new($stderr)
|
28
|
+
end
|
17
29
|
@debug_mode = false
|
18
30
|
end
|
19
31
|
|
@@ -62,8 +62,15 @@ module Fusuma
|
|
62
62
|
if status == 'update'
|
63
63
|
return unless moved?(prev_event, event)
|
64
64
|
|
65
|
-
avg_zoom =
|
66
|
-
|
65
|
+
first_zoom, avg_zoom = if updating_events.size >= 10
|
66
|
+
[updating_events[-10].record.delta.zoom,
|
67
|
+
gesture_buffer.class.new(
|
68
|
+
updating_events[-10..-1]
|
69
|
+
).avg_attrs(:zoom)]
|
70
|
+
else
|
71
|
+
[updating_events.first.record.delta.zoom,
|
72
|
+
gesture_buffer.avg_attrs(:zoom)]
|
73
|
+
end
|
67
74
|
|
68
75
|
oneshot_quantity = Quantity.new(target: avg_zoom, base: first_zoom).to_f
|
69
76
|
oneshot_direction = Direction.new(target: avg_zoom, base: first_zoom).to_s
|
@@ -24,8 +24,14 @@ module Fusuma
|
|
24
24
|
updating_events = gesture_buffer.updating_events
|
25
25
|
return if updating_events.empty?
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
oneshot_angle = if updating_events.size >= 10
|
28
|
+
updating_time = 100 * (updating_events[-1].time - updating_events[-10].time)
|
29
|
+
last_10 = gesture_buffer.class.new(updating_events[-10..-1])
|
30
|
+
last_10.sum_attrs(:rotate) / updating_time
|
31
|
+
else
|
32
|
+
updating_time = 100 * (updating_events.last.time - updating_events.first.time)
|
33
|
+
gesture_buffer.sum_attrs(:rotate) / updating_time
|
34
|
+
end
|
29
35
|
|
30
36
|
return if updating_events.empty?
|
31
37
|
|
@@ -24,9 +24,17 @@ module Fusuma
|
|
24
24
|
updating_events = gesture_buffer.updating_events
|
25
25
|
return if updating_events.empty?
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
oneshot_move_x, oneshot_move_y = if updating_events.size >= 10
|
28
|
+
updating_time = 100 * (updating_events[-1].time - updating_events[-10].time)
|
29
|
+
last_10 = gesture_buffer.class.new(updating_events[-10..-1])
|
30
|
+
[last_10.sum_attrs(:move_x) / updating_time,
|
31
|
+
last_10.sum_attrs(:move_y) / updating_time]
|
32
|
+
else
|
33
|
+
updating_time = 100 * (updating_events.last.time - updating_events.first.time)
|
34
|
+
[gesture_buffer.sum_attrs(:move_x) / updating_time,
|
35
|
+
gesture_buffer.sum_attrs(:move_y) / updating_time]
|
36
|
+
end
|
37
|
+
gesture_buffer.sum_attrs(:move_x) / updating_time
|
30
38
|
|
31
39
|
finger = gesture_buffer.finger
|
32
40
|
status = case gesture_buffer.events.last.record.status
|
data/lib/fusuma/version.rb
CHANGED
data/lib/fusuma.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusuma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fusuma is multitouch gesture recognizer. This gem makes your touchpad
|
14
14
|
on Linux able to recognize swipes or pinchs and assign command to them. Read installation
|
@@ -106,7 +106,7 @@ licenses:
|
|
106
106
|
- MIT
|
107
107
|
metadata:
|
108
108
|
yard.run: yri
|
109
|
-
post_install_message:
|
109
|
+
post_install_message:
|
110
110
|
rdoc_options: []
|
111
111
|
require_paths:
|
112
112
|
- lib
|
@@ -121,44 +121,44 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
125
|
-
signing_key:
|
124
|
+
rubygems_version: 3.2.22
|
125
|
+
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Multitouch gestures with libinput driver, Linux
|
128
128
|
test_files:
|
129
|
-
- spec/
|
129
|
+
- spec/helpers/config_helper.rb
|
130
130
|
- spec/lib/config/searcher_spec.rb
|
131
|
-
- spec/lib/
|
131
|
+
- spec/lib/config_spec.rb
|
132
|
+
- spec/lib/custom_process_spec.rb
|
133
|
+
- spec/lib/device_spec.rb
|
132
134
|
- spec/lib/dummy_config.yml
|
135
|
+
- spec/lib/fusuma_spec.rb
|
136
|
+
- spec/lib/libinput-list-devices_iberianpig-XPS-9360.txt
|
133
137
|
- spec/lib/libinput-list-devices_magic_trackpad.txt
|
134
|
-
- spec/lib/
|
138
|
+
- spec/lib/libinput-list-devices_razer_razer_blade.txt
|
139
|
+
- spec/lib/libinput-list-devices_thejinx0r.txt
|
140
|
+
- spec/lib/libinput-list-devices_unavailable.txt
|
141
|
+
- spec/lib/libinput_command_spec.rb
|
135
142
|
- spec/lib/plugin/base_spec.rb
|
136
|
-
- spec/lib/plugin/
|
137
|
-
- spec/lib/plugin/
|
138
|
-
- spec/lib/plugin/
|
139
|
-
- spec/lib/plugin/
|
143
|
+
- spec/lib/plugin/buffers/buffer_spec.rb
|
144
|
+
- spec/lib/plugin/buffers/dummy_buffer.rb
|
145
|
+
- spec/lib/plugin/buffers/gesture_buffer_spec.rb
|
146
|
+
- spec/lib/plugin/detectors/detector_spec.rb
|
147
|
+
- spec/lib/plugin/detectors/dummy_detector.rb
|
148
|
+
- spec/lib/plugin/detectors/pinch_detector_spec.rb
|
149
|
+
- spec/lib/plugin/detectors/rotate_detector_spec.rb
|
150
|
+
- spec/lib/plugin/detectors/swipe_detector_spec.rb
|
151
|
+
- spec/lib/plugin/events/event_spec.rb
|
140
152
|
- spec/lib/plugin/events/records/gesture_record_spec.rb
|
153
|
+
- spec/lib/plugin/events/records/record_spec.rb
|
141
154
|
- spec/lib/plugin/events/records/text_record_spec.rb
|
142
|
-
- spec/lib/plugin/
|
143
|
-
- spec/lib/plugin/
|
155
|
+
- spec/lib/plugin/executors/command_executor_spec.rb
|
156
|
+
- spec/lib/plugin/executors/executor_spec.rb
|
144
157
|
- spec/lib/plugin/filters/filter_spec.rb
|
145
|
-
- spec/lib/plugin/
|
146
|
-
- spec/lib/plugin/
|
147
|
-
- spec/lib/plugin/
|
148
|
-
- spec/lib/plugin/
|
149
|
-
- spec/lib/plugin/detectors/dummy_detector.rb
|
158
|
+
- spec/lib/plugin/filters/libinput_filter_spec.rb
|
159
|
+
- spec/lib/plugin/inputs/input_spec.rb
|
160
|
+
- spec/lib/plugin/inputs/libinput_command_input_spec.rb
|
161
|
+
- spec/lib/plugin/inputs/timer_input_spec.rb
|
150
162
|
- spec/lib/plugin/manager_spec.rb
|
151
|
-
- spec/lib/plugin/buffers/dummy_buffer.rb
|
152
|
-
- spec/lib/plugin/buffers/buffer_spec.rb
|
153
|
-
- spec/lib/plugin/buffers/gesture_buffer_spec.rb
|
154
163
|
- spec/lib/plugin/parsers/parser_spec.rb
|
155
|
-
- spec/lib/plugin/executors/executor_spec.rb
|
156
|
-
- spec/lib/plugin/executors/command_executor_spec.rb
|
157
|
-
- spec/lib/libinput-list-devices_unavailable.txt
|
158
|
-
- spec/lib/libinput_command_spec.rb
|
159
|
-
- spec/lib/fusuma_spec.rb
|
160
|
-
- spec/lib/libinput-list-devices_razer_razer_blade.txt
|
161
|
-
- spec/lib/libinput-list-devices_thejinx0r.txt
|
162
|
-
- spec/lib/config_spec.rb
|
163
|
-
- spec/helpers/config_helper.rb
|
164
164
|
- spec/spec_helper.rb
|