xinput_wrapper 0.1.2 → 0.1.3

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: ba522ef8d9234f3e5972d9c86594b04795da3aca
4
- data.tar.gz: 8d148a4bd5df32c2f8a46992eab08934fc8f0d6e
3
+ metadata.gz: d2487ccda5f3bb7af5fa098b2e521edf98c7d1e4
4
+ data.tar.gz: d8c547a5da867932cc4cf8611bb2efb0e1d59dbe
5
5
  SHA512:
6
- metadata.gz: 373c48d88ad2dd7af5c34a58682c2af68e41ea67299d4f5a772519a505cca3050afff2f017d50792e4283b463d126cb1ca08ccea58fc8d317260abb219194266
7
- data.tar.gz: d7b6195c8a226f5b121fb634ed9db4bdb28c1774d1e297dde8bdbb25d5bd4849fba9c40ceba9925b6b876a2b6e7c9ca31f1d62428ae259424bc6e5cf8fc2fd78
6
+ metadata.gz: 37f5a0d2175879a3797bfc7b4bccf4070982b08cb01c99d73da62ea1b7ca1ee93a597ff1a43fe5a463d09110a0db6b210a36903030f0cda9ad3f54f07052b711
7
+ data.tar.gz: 9a3efa111712126a516d19220d31254e259536079ecf474ffea5a160161de59c2cc616de83eb376f5345d4055712c6f3359b42ab65fa391cb47a0e931042e187
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -10,7 +10,8 @@ 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: {}, interval: nil)
13
+ topic: 'input/keyboard', verbose: true, lookup: {},
14
+ interval: nil, debug: false)
14
15
 
15
16
  @lookup = {
16
17
  37 => :control,
@@ -18,10 +19,10 @@ class XInputWrapper
18
19
  133 => :super
19
20
  }.merge(lookup)
20
21
 
21
- @device, @topic, @verbose = device, topic, verbose
22
+ @device, @topic, @verbose, @debug = device, topic, verbose, debug
22
23
  @sps = SPSPub.new host: host, port: port
23
24
  @sk = SecretKnock.new short_delay: 0.25, long_delay: 0.5,
24
- external: self, verbose: verbose
25
+ external: self, verbose: verbose, debug: debug
25
26
  @interval = interval
26
27
  @time = Time.now if interval
27
28
 
@@ -58,8 +59,10 @@ class XInputWrapper
58
59
  if type == 13 then
59
60
 
60
61
  keycode = x[/detail: (\d+)/,1].to_i
62
+ next if keycode == 0
61
63
 
62
64
  puts 'keycode: ' + keycode.to_s if keycode > 0 and @verbose
65
+ puts '>keycode: ' + keycode.to_s if @debug
63
66
 
64
67
  if @interval then
65
68
 
@@ -79,8 +82,10 @@ class XInputWrapper
79
82
  puts 'super key pressed' if @verbose
80
83
  message 'super key pressed'
81
84
  end
85
+
86
+ sk.reset if @lookup[keycode] != :control
82
87
 
83
88
  end
84
89
  end
85
90
  end
86
- end
91
+ end
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.2
4
+ version: 0.1.3
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-11-07 00:00:00.000000000 Z
34
+ date: 2018-08-05 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sps-pub
metadata.gz.sig CHANGED
Binary file