fusuma-plugin-remap 0.10.0 → 0.11.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55e5ef616cbf48bc0a8c3a4c0b9b91dbed01c3b4dc87f53f09fa51ab6c34227
|
4
|
+
data.tar.gz: 1e34c8882e52d3191092576ab5d056d74c1ea0d130963a37304ce2a8bc6b0fdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb30877c6629814e6aff80127aa63045e4901d416a568d1a6f0e7f268254509903df5df8d90382a7d739ea3b2a6b666a461f57d9af0ce00941152d2296953efd
|
7
|
+
data.tar.gz: f11178d8bf7c553a1568b67e1a62b4cb747d51c0b67008330b98b17228b82a5d41cecd5b4de2f259d2d572f539e4f55daaa75f79fdd7c3a2608ac4013a2473f7
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../remap/touchpad_remapper"
|
4
|
-
# require_relative "../remap/layer_manager"
|
5
4
|
|
6
5
|
module Fusuma
|
7
6
|
module Plugin
|
@@ -35,22 +34,7 @@ module Fusuma
|
|
35
34
|
|
36
35
|
gesture = "touch"
|
37
36
|
finger = data["finger"]
|
38
|
-
|
39
|
-
# @touch_state ||= {}
|
40
|
-
# @mt_slot ||= 0
|
41
|
-
# @touch_state[@mt_slot] ||= {
|
42
|
-
# MT_TRACKING_ID: nil,
|
43
|
-
# X: nil,
|
44
|
-
# Y: nil,
|
45
|
-
# valid_touch_point: false
|
46
|
-
# }
|
47
|
-
# TODO: implement update touch_state
|
48
|
-
status =
|
49
|
-
if data["touch_state"].any? { |_, v| v["valid_touch_point"] }
|
50
|
-
"begin"
|
51
|
-
else
|
52
|
-
"end"
|
53
|
-
end
|
37
|
+
status = data["status"]
|
54
38
|
|
55
39
|
Events::Records::GestureRecord.new(gesture: gesture, status: status, finger: finger, delta: nil)
|
56
40
|
rescue EOFError => e
|
@@ -18,7 +18,6 @@ module Fusuma
|
|
18
18
|
@source_touchpads = source_touchpads # original touchpad
|
19
19
|
@fusuma_writer = fusuma_writer # write event to fusuma_input
|
20
20
|
|
21
|
-
# FIXME: PalmDetection should be initialized with each touchpad
|
22
21
|
@palm_detectors = @source_touchpads.each_with_object({}) do |source_touchpad, palm_detectors|
|
23
22
|
palm_detectors[source_touchpad] = PalmDetection.new(source_touchpad)
|
24
23
|
end
|
@@ -34,6 +33,9 @@ module Fusuma
|
|
34
33
|
touch_state = {}
|
35
34
|
mt_slot = 0
|
36
35
|
finger_state = nil
|
36
|
+
|
37
|
+
prev_valid_touch = false
|
38
|
+
prev_status = nil
|
37
39
|
loop do
|
38
40
|
ios = IO.select(@source_touchpads.map(&:file)) # , @layer_manager.reader])
|
39
41
|
io = ios&.first&.first
|
@@ -131,10 +133,29 @@ module Fusuma
|
|
131
133
|
end
|
132
134
|
|
133
135
|
if syn_report
|
136
|
+
# Whether any slot is valid (touching)
|
137
|
+
valid_touch = touch_state.any? { |_, st| st[:valid_touch_point] }
|
138
|
+
|
139
|
+
status =
|
140
|
+
if valid_touch
|
141
|
+
prev_valid_touch ? "update" : "begin"
|
142
|
+
else
|
143
|
+
prev_valid_touch ? "end" : "cancelled"
|
144
|
+
end
|
145
|
+
|
146
|
+
if status == prev_status
|
147
|
+
next
|
148
|
+
end
|
149
|
+
|
134
150
|
# TODO: define format as fusuma_input
|
135
151
|
# TODO: Add data to identify multiple touchpads
|
136
|
-
data = {
|
152
|
+
data = {
|
153
|
+
finger: finger_state,
|
154
|
+
status: status
|
155
|
+
}
|
137
156
|
@fusuma_writer.write(data.to_msgpack)
|
157
|
+
prev_status = status
|
158
|
+
prev_valid_touch = valid_touch
|
138
159
|
end
|
139
160
|
end
|
140
161
|
rescue => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusuma-plugin-remap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fusuma
|