xinput_wrapper 0.1.1 → 0.1.2

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: c3903d1dfa16bf7e743aee402009f44e536e1da8
4
- data.tar.gz: 69887fc65d3f95a6142ff25f81d8baeba5b87861
3
+ metadata.gz: ba522ef8d9234f3e5972d9c86594b04795da3aca
4
+ data.tar.gz: 8d148a4bd5df32c2f8a46992eab08934fc8f0d6e
5
5
  SHA512:
6
- metadata.gz: 374014c88dedc0eeea697e325cf32964fd50e8fb3597633e21e12fd9a51b6ab5e2e211b7499f74523c8268d862bd59f43d04be1c4f958aface14fb80528269ad
7
- data.tar.gz: d3d31a90923f35d51a58909b02cff43d6dc6320bc40402d079179b716c42f3f1c3c00d38e315506f50f50f764b5c449abc6836baf7698dedbd12fb51d90cdc41
6
+ metadata.gz: 373c48d88ad2dd7af5c34a58682c2af68e41ea67299d4f5a772519a505cca3050afff2f017d50792e4283b463d126cb1ca08ccea58fc8d317260abb219194266
7
+ data.tar.gz: d7b6195c8a226f5b121fb634ed9db4bdb28c1774d1e297dde8bdbb25d5bd4849fba9c40ceba9925b6b876a2b6e7c9ca31f1d62428ae259424bc6e5cf8fc2fd78
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -10,7 +10,7 @@ require 'secret_knock'
10
10
  class XInputWrapper
11
11
 
12
12
  def initialize(device: '3', host: 'sps', port: '59000',
13
- topic: 'input/keyboard', verbose: true, lookup: {})
13
+ topic: 'input/keyboard', verbose: true, lookup: {}, interval: nil)
14
14
 
15
15
  @lookup = {
16
16
  37 => :control,
@@ -22,6 +22,9 @@ class XInputWrapper
22
22
  @sps = SPSPub.new host: host, port: port
23
23
  @sk = SecretKnock.new short_delay: 0.25, long_delay: 0.5,
24
24
  external: self, verbose: verbose
25
+ @interval = interval
26
+ @time = Time.now if interval
27
+
25
28
  end
26
29
 
27
30
  def knock()
@@ -57,6 +60,14 @@ class XInputWrapper
57
60
  keycode = x[/detail: (\d+)/,1].to_i
58
61
 
59
62
  puts 'keycode: ' + keycode.to_s if keycode > 0 and @verbose
63
+
64
+ if @interval then
65
+
66
+ if Time.now > @time + @interval then
67
+ @sps.notice "%s: key pressed" % [@topic]
68
+ @time = Time.now
69
+ end
70
+ end
60
71
 
61
72
  case @lookup[keycode]
62
73
  when :lshift
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xinput_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  0ymew047+vZ5lDTOdEUMd+CsRmgoJBLRWXaTiHO05e7v3xtW9wDxP01a+FGQiYcj
32
32
  5bdH23akkNF4CA==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-08-13 00:00:00.000000000 Z
34
+ date: 2017-11-07 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sps-pub
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.6.8
103
+ rubygems_version: 2.6.13
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: A wrapper for the Linux utility xinput. Publishes an SPS message whenever
metadata.gz.sig CHANGED
Binary file