xinput_wrapperplus 0.3.0 → 0.4.3
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -2
- data/lib/xinput_wrapperplus.rb +69 -15
- metadata +35 -30
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17f7c9962bda5c450ccf2255914fcc3d578f4bfd1881c4297b728764afcaeb0d
|
4
|
+
data.tar.gz: f9e67bdc4325d252e5dacb74b75c2c0ebae60252d52c2900e577c2d0cadc0e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5352fc684255d867db2432619244b302e6a34a98acc536402a4da073b3ee660667caf33c307fdfffc860dd886f2cca6f6168c4d78978d541c5689e427f4b37e4
|
7
|
+
data.tar.gz: 170ed7c1a421a4f0a0c1ac1b86d7b2cec01ff72169d48725eb8e2051e3dbb5aa80e353e33ec6965e82b81a203dce4f6b83f80b56627b2c8c0780dbbdd77e8d19
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
��
|
2
|
-
|
1
|
+
��߀�2��"l���0�"�G�E�o�������m�MK���T���Y7����>����1�����
|
2
|
+
�;0��?Yk_a5��O�v�iK��\dz�я�'���v>g��!��R��E��:�u��ŲO��[�ȹT}�S��G��s���j�l�����̙N�Ή�"�pv�{���T;�8�l=�d�;����v�=1�qp��:��g�u�2;�"��x�3�@Y��)d��j�h�`M9�]�<�67[��'�.�Z/ ��kf
|
3
|
+
�md��?�7�4jo��$�"F�@e�!�ʚ��H �yT��J�^��,yy؊M�=�?��� �t��d�ĻA���M*��2#e�l��.k5l}X�]:�����"��7F�A��)��
|
data/lib/xinput_wrapperplus.rb
CHANGED
@@ -9,53 +9,107 @@ require 'xinput_wrapper'
|
|
9
9
|
|
10
10
|
class XInputWrapperPlus < XInputWrapper
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
topic: 'input
|
14
|
-
debug: false, capture_all: false
|
12
|
+
def initialize(host: 'sps', port: '59000',
|
13
|
+
topic: 'input', verbose: true, lookup: {},
|
14
|
+
debug: false, capture_all: false, keys: [],
|
15
|
+
keypress_detection: true, motion_detection: true)
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
puts 'before super'
|
18
|
+
super(verbose: verbose, lookup: lookup,
|
19
|
+
debug: debug, keys: keys)
|
20
|
+
puts 'after super'
|
21
|
+
|
18
22
|
@topic, @capture_all = topic, capture_all
|
23
|
+
@keypress_detection = keypress_detection
|
24
|
+
@motion_detection = motion_detection
|
25
|
+
|
19
26
|
@sps = SPSPub.new host: host, port: port
|
27
|
+
|
20
28
|
@sk = SecretKnock.new short_delay: 0.25, long_delay: 0.5,
|
21
29
|
external: self, verbose: verbose, debug: debug
|
22
30
|
@sk.detect timeout: 0.7
|
23
31
|
|
24
|
-
|
32
|
+
@a = [] # Used to store mouse gestures
|
33
|
+
@timer, @t2 = nil , Time.now - 30
|
25
34
|
|
35
|
+
end
|
26
36
|
|
27
37
|
def knock()
|
28
38
|
puts 'knock' if @verbose
|
29
39
|
end
|
30
|
-
|
31
|
-
def message(msg)
|
40
|
+
|
41
|
+
def message(msg, subtopic=:keyboard)
|
32
42
|
|
33
43
|
puts ':: ' + msg.inspect if @verbose
|
34
44
|
|
35
45
|
return if msg.strip.empty?
|
36
46
|
|
37
|
-
|
47
|
+
topic = [@topic, subtopic].compact.join('/')
|
48
|
+
|
49
|
+
@sps.notice "%s: %s" % [topic, msg]
|
38
50
|
|
39
|
-
end
|
51
|
+
end
|
40
52
|
|
41
|
-
|
53
|
+
private
|
54
|
+
|
55
|
+
def anykey_press()
|
56
|
+
|
57
|
+
if @keypress_detection and (Time.now > @t2 + 30) then
|
58
|
+
message 'keypress detected', nil
|
59
|
+
@t2 = Time.now
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
42
63
|
|
43
64
|
def on_control_key()
|
44
65
|
puts 'inside on_control_key' if @debug
|
45
66
|
@sk.knock
|
46
67
|
end
|
47
68
|
|
69
|
+
def on_gesture(a)
|
70
|
+
|
71
|
+
puts 'inside on_gesture' if @debug
|
72
|
+
points = @a.map {|coords| coords.map {|x| x}.join(',') }.join(' ')
|
73
|
+
message points, 'motion'
|
74
|
+
|
75
|
+
end
|
76
|
+
|
48
77
|
def on_key_press(key, keycode, modifier=[])
|
49
78
|
|
50
79
|
puts 'inside on_key_press' if @debug
|
51
80
|
|
52
|
-
if @capture_all
|
81
|
+
message format_key(key, modifier) if @capture_all
|
82
|
+
|
83
|
+
@sk.reset if @lookup[keycode] != :control
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
def on_mousemove(x,y)
|
88
|
+
|
89
|
+
if @debug then
|
90
|
+
puts "on_mousemove() x: %s y: %s" % [x, y]
|
91
|
+
end
|
92
|
+
|
93
|
+
if @motion_detection and (Time.now > @t2 + 30) then
|
94
|
+
message 'motion detected', nil
|
95
|
+
@t2 = Time.now
|
96
|
+
end
|
97
|
+
=begin
|
98
|
+
@timer.exit if @timer
|
99
|
+
|
100
|
+
@a << [x,y]
|
101
|
+
|
102
|
+
|
103
|
+
@timer = Thread.new do
|
104
|
+
|
105
|
+
sleep 0.25
|
106
|
+
puts 'inside timer' if @debug
|
53
107
|
|
54
|
-
|
108
|
+
on_gesture(@a) if @a.length > 6 and @a.length < 36
|
109
|
+
@a = []
|
55
110
|
|
56
111
|
end
|
57
|
-
|
58
|
-
@sk.reset if @lookup[keycode] != :control
|
112
|
+
=end
|
59
113
|
|
60
114
|
end
|
61
115
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xinput_wrapperplus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,27 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjAwODI1MTI0NjA1WhcN
|
15
|
+
MjEwODI1MTI0NjA1WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDUcQ9Q
|
17
|
+
hWoREpFe1iiNNIh72yJEQOy7wlCjQN7hf57/0yqU1Lb37mfRdSQXEhAWJakWxPn/
|
18
|
+
VhTr9lhh7XgIIrDDMIIM0+qe0Ean+ctTQSl0kVTD0gz2yJ1Gn4S96vf69YeoLOr/
|
19
|
+
rnidQqQgMJ2yh6fmwbsXNLpBMhd2ZU0ly1ly6b6jkH4gkJLSSPakZ4cc2tbTcqsu
|
20
|
+
goh5h16uc/Mwmk/f/UCsSfuvyRM5gFTthfkXloGTBsvznN8xtnZlwmU+8Jwjp4HQ
|
21
|
+
HUfYvDtIwyCW44osWP+Av9IVNCv2OjJJgTc8EG58HW/rTLc+Nk7i7BqHAbRV9SJs
|
22
|
+
eVBLz/CUmi1yYy93vQtCwjwhOYpx+b12k2bISlNcHETzkHMdue0w1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000000000 Z
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: sps-pub
|
@@ -76,22 +81,22 @@ dependencies:
|
|
76
81
|
name: xinput_wrapper
|
77
82
|
requirement: !ruby/object:Gem::Requirement
|
78
83
|
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: 0.4.0
|
82
84
|
- - "~>"
|
83
85
|
- !ruby/object:Gem::Version
|
84
|
-
version: '0.
|
86
|
+
version: '0.8'
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.8.1
|
85
90
|
type: :runtime
|
86
91
|
prerelease: false
|
87
92
|
version_requirements: !ruby/object:Gem::Requirement
|
88
93
|
requirements:
|
89
|
-
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: 0.4.0
|
92
94
|
- - "~>"
|
93
95
|
- !ruby/object:Gem::Version
|
94
|
-
version: '0.
|
96
|
+
version: '0.8'
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.8.1
|
95
100
|
description:
|
96
101
|
email: james@jamesrobertson.eu
|
97
102
|
executables: []
|
@@ -118,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
123
|
- !ruby/object:Gem::Version
|
119
124
|
version: '0'
|
120
125
|
requirements: []
|
121
|
-
rubygems_version: 3.0.
|
126
|
+
rubygems_version: 3.0.3
|
122
127
|
signing_key:
|
123
128
|
specification_version: 4
|
124
129
|
summary: A wrapper for the Linux utility xinput. Publishes an SPS message whenever
|
metadata.gz.sig
CHANGED
Binary file
|