fusuma 0.2.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 148b3255a66309d6e395563434f329d9d2aa7644
4
- data.tar.gz: 2aa17df3eccdf7efb2b672ecd1d238a8513d50a7
3
+ metadata.gz: d452e20ebad5d8c74a1024a89efca191cb81393c
4
+ data.tar.gz: 2b2bf688c6cac49dd066984c90716b81bef7f27c
5
5
  SHA512:
6
- metadata.gz: 223772b06f859d05839ba166204d996a844e33772dfc7262e043da3a36fd411ac969dc9576d49bd1ad73d70fed1aa2baf03b42365c2ef24f3289cc8dd714576e
7
- data.tar.gz: c8e9fd768b01da06eee21c7248159d0bd89c8fdc0cbd51f8929f2e93afe3eca1a3a900270f829ff1c3dcfe95d20221f797dfe80b085f3834fa082310fcef3a98
6
+ metadata.gz: ae305dcac96bb69a2fee49023db151ecbf43d8352c4e3420b76502a7cc6ecd28524af3dd530d8a2ec94e77f76d0f0c9d748295480feeb72c1116d5c2c74694e3
7
+ data.tar.gz: 27b1bcc29712827903be117dff7ea92cabe03c629c2ff2a26e26600e164e035506f472bbea3ebc62a5d3626550a67cc065402b1b6f8506f0258be03b15585ead
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0
5
4
  - 2.1
6
5
  - 2.2
7
6
  - 2.3.1
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 # Log out and back in to assign this group
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
- if the swipe's threshold change to `0.5`, shorten swipe-length by half
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)
@@ -26,3 +26,7 @@ pinch:
26
26
  threshold:
27
27
  swipe: 1
28
28
  pinch: 1
29
+
30
+ interval:
31
+ swipe: 1
32
+ pinch: 1
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
- INTERVAL_TIME = 0.05
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) > INTERVAL_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
- INTERVAL_TIME = 0.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) > INTERVAL_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
 
@@ -1,3 +1,3 @@
1
1
  module Fusuma
2
- VERSION = '0.2.7'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
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.2.7
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-02-04 00:00:00.000000000 Z
11
+ date: 2017-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler