fusuma 0.2.7 → 0.3.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 +4 -4
- data/.travis.yml +0 -1
- data/README.md +17 -2
- data/lib/fusuma/config.rb +9 -0
- data/lib/fusuma/config.yml +4 -0
- data/lib/fusuma/pinch.rb +6 -2
- data/lib/fusuma/swipe.rb +6 -2
- data/lib/fusuma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d452e20ebad5d8c74a1024a89efca191cb81393c
|
4
|
+
data.tar.gz: 2b2bf688c6cac49dd066984c90716b81bef7f27c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae305dcac96bb69a2fee49023db151ecbf43d8352c4e3420b76502a7cc6ecd28524af3dd530d8a2ec94e77f76d0f0c9d748295480feeb72c1116d5c2c74694e3
|
7
|
+
data.tar.gz: 27b1bcc29712827903be117dff7ea92cabe03c629c2ff2a26e26600e164e035506f472bbea3ebc62a5d3626550a67cc065402b1b6f8506f0258be03b15585ead
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,9 @@ This gem makes your linux PC able to recognize swipes or pinchs and assign short
|
|
12
12
|
IMPORTANT: You must be a member of the _input_ group to have permission
|
13
13
|
to read the touchpad device:
|
14
14
|
|
15
|
-
$ sudo gpasswd -a $USER input
|
15
|
+
$ sudo gpasswd -a $USER input
|
16
|
+
|
17
|
+
You must log out and back in or restart to assign this group.
|
16
18
|
|
17
19
|
You need libinput release 1.0 or later. Install libinput-tools:
|
18
20
|
|
@@ -26,6 +28,12 @@ Install Fusuma:
|
|
26
28
|
|
27
29
|
$ gem install fusuma
|
28
30
|
|
31
|
+
### Touchpad not working in GNOME
|
32
|
+
|
33
|
+
Ensure the touchpad events are being sent to the GNOME desktop by running the following command:
|
34
|
+
|
35
|
+
$ gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
|
36
|
+
|
29
37
|
## Usage
|
30
38
|
|
31
39
|
$ fusuma
|
@@ -71,12 +79,19 @@ pinch:
|
|
71
79
|
threshold:
|
72
80
|
swipe: 1
|
73
81
|
pinch: 1
|
82
|
+
|
83
|
+
interval:
|
84
|
+
swipe: 1
|
85
|
+
pinch: 1
|
74
86
|
```
|
75
87
|
|
76
88
|
if `shortcut: ` is blank, the swipe/pinch doesn't trigger a keyevent.
|
77
89
|
|
78
90
|
`threshold:` is sensitivity to swipe/pinch. Default value is 1.
|
79
|
-
|
91
|
+
If the swipe's threshold is `0.5`, shorten swipe-length by half.
|
92
|
+
|
93
|
+
`interval:` is delay between swipes/pinches. Default value is 1.
|
94
|
+
If the swipe's interval is `0.5`, shorten swipe-interval by half to recognize a next swipe.
|
80
95
|
|
81
96
|
## Options
|
82
97
|
|
data/lib/fusuma/config.rb
CHANGED
@@ -14,6 +14,10 @@ module Fusuma
|
|
14
14
|
instance.threshold(action_type)
|
15
15
|
end
|
16
16
|
|
17
|
+
def interval(action_type)
|
18
|
+
instance.interval(action_type)
|
19
|
+
end
|
20
|
+
|
17
21
|
def reload
|
18
22
|
instance.reload
|
19
23
|
end
|
@@ -43,6 +47,11 @@ module Fusuma
|
|
43
47
|
cache(seek_index) { search_config(keymap, seek_index) } || 1
|
44
48
|
end
|
45
49
|
|
50
|
+
def interval(action_type)
|
51
|
+
seek_index = ['interval', action_type]
|
52
|
+
cache(seek_index) { search_config(keymap, seek_index) } || 1
|
53
|
+
end
|
54
|
+
|
46
55
|
private
|
47
56
|
|
48
57
|
def search_config(keymap_node, seek_index)
|
data/lib/fusuma/config.yml
CHANGED
data/lib/fusuma/pinch.rb
CHANGED
@@ -2,7 +2,7 @@ module Fusuma
|
|
2
2
|
# vector data
|
3
3
|
class Pinch
|
4
4
|
BASE_THERESHOLD = 0.3
|
5
|
-
|
5
|
+
BASE_INTERVAL = 0.05
|
6
6
|
|
7
7
|
def initialize(diameter)
|
8
8
|
@diameter = diameter.to_f
|
@@ -28,7 +28,7 @@ module Fusuma
|
|
28
28
|
|
29
29
|
def enough_interval?
|
30
30
|
return true if first_time?
|
31
|
-
return true if (Time.now - self.class.last_time) >
|
31
|
+
return true if (Time.now - self.class.last_time) > interval_time
|
32
32
|
false
|
33
33
|
end
|
34
34
|
|
@@ -40,6 +40,10 @@ module Fusuma
|
|
40
40
|
@threshold ||= BASE_THERESHOLD * Config.threshold('pinch')
|
41
41
|
end
|
42
42
|
|
43
|
+
def interval_time
|
44
|
+
@interval_time ||= BASE_INTERVAL * Config.interval('pinch')
|
45
|
+
end
|
46
|
+
|
43
47
|
class << self
|
44
48
|
attr_reader :last_time
|
45
49
|
|
data/lib/fusuma/swipe.rb
CHANGED
@@ -2,7 +2,7 @@ module Fusuma
|
|
2
2
|
# vector data
|
3
3
|
class Swipe
|
4
4
|
BASE_THERESHOLD = 20
|
5
|
-
|
5
|
+
BASE_INTERVAL = 0.5
|
6
6
|
|
7
7
|
def initialize(x, y)
|
8
8
|
@x = x
|
@@ -28,7 +28,7 @@ module Fusuma
|
|
28
28
|
|
29
29
|
def enough_interval?
|
30
30
|
return true if first_time?
|
31
|
-
return true if (Time.now - self.class.last_time) >
|
31
|
+
return true if (Time.now - self.class.last_time) > interval_time
|
32
32
|
false
|
33
33
|
end
|
34
34
|
|
@@ -40,6 +40,10 @@ module Fusuma
|
|
40
40
|
@threshold ||= BASE_THERESHOLD * Config.threshold('swipe')
|
41
41
|
end
|
42
42
|
|
43
|
+
def interval_time
|
44
|
+
@interval_time ||= BASE_INTERVAL * Config.interval('swipe')
|
45
|
+
end
|
46
|
+
|
43
47
|
class << self
|
44
48
|
attr_reader :last_time
|
45
49
|
|
data/lib/fusuma/version.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: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|