xinput_wrapperplus 0.4.0 → 0.5.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
- checksums.yaml.gz.sig +0 -0
- data/lib/xinput_wrapperplus.rb +48 -12
- data.tar.gz.sig +0 -0
- metadata +57 -31
- 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: e7895cc28fe6d61322a6ec002f8dcded48d448c5dea63b4264181d9cd4a06a6f
|
4
|
+
data.tar.gz: 6368b33575a4e730fc58e42cdd4b4f50ed9ce728061bbb073f9ad30a28c65822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d621312320338465c881475f038054a758f43666469295bf4f572dadb23a299d64a673ce66ce8aab1777d85aefe896711c9df8f2f9a242d40d2e6f2912e6cd
|
7
|
+
data.tar.gz: 5932216f417c697613ede7355ed9b30e42e50479e21f5e679f6913a52aa4137b522ace656aedb8e3935509408d3abd1fe842d7c57896f8dec910967d890dca3c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/xinput_wrapperplus.rb
CHANGED
@@ -3,47 +3,78 @@
|
|
3
3
|
# file: xinput_wrapperplus.rb
|
4
4
|
|
5
5
|
|
6
|
+
require 'wmctrl'
|
6
7
|
require 'sps-pub'
|
7
8
|
require 'secret_knock'
|
8
9
|
require 'xinput_wrapper'
|
9
10
|
|
10
11
|
class XInputWrapperPlus < XInputWrapper
|
11
12
|
|
12
|
-
def initialize(
|
13
|
+
def initialize(host: 'sps', port: '59000',
|
13
14
|
topic: 'input', verbose: true, lookup: {},
|
14
|
-
debug: false, capture_all: false
|
15
|
+
debug: false, capture_all: false, keys: [],
|
16
|
+
keypress_detection: true, motion_detection: true,
|
17
|
+
window_context: false)
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
puts 'before super'
|
20
|
+
super(verbose: verbose, lookup: lookup,
|
21
|
+
debug: debug, keys: keys)
|
22
|
+
puts 'after super'
|
23
|
+
|
18
24
|
@topic, @capture_all = topic, capture_all
|
25
|
+
@keypress_detection = keypress_detection
|
26
|
+
@motion_detection = motion_detection
|
27
|
+
@window_context = window_context
|
28
|
+
|
19
29
|
@sps = SPSPub.new host: host, port: port
|
30
|
+
|
20
31
|
@sk = SecretKnock.new short_delay: 0.25, long_delay: 0.5,
|
21
32
|
external: self, verbose: verbose, debug: debug
|
22
33
|
@sk.detect timeout: 0.7
|
34
|
+
@interval = 120
|
23
35
|
|
24
36
|
@a = [] # Used to store mouse gestures
|
25
|
-
@timer = nil
|
37
|
+
@timer, @t2 = nil , Time.now - @interval
|
26
38
|
|
27
39
|
end
|
28
40
|
|
29
|
-
|
30
41
|
def knock()
|
31
42
|
puts 'knock' if @verbose
|
32
43
|
end
|
33
|
-
|
44
|
+
|
34
45
|
def message(msg, subtopic=:keyboard)
|
35
46
|
|
36
47
|
puts ':: ' + msg.inspect if @verbose
|
37
48
|
|
38
49
|
return if msg.strip.empty?
|
39
50
|
|
40
|
-
topic = [@topic, subtopic].join('/')
|
51
|
+
topic = [@topic, subtopic].compact.join('/')
|
41
52
|
|
42
|
-
@
|
53
|
+
if @window_context then
|
54
|
+
|
55
|
+
wm = WMCtrl.display
|
56
|
+
win = wm.windows.find {|x| x.active}
|
57
|
+
|
58
|
+
@sps.notice "%s: %s in %s" % [topic, msg, win.title]
|
59
|
+
|
60
|
+
else
|
61
|
+
|
62
|
+
@sps.notice "%s: %s" % [topic, msg]
|
63
|
+
|
64
|
+
end
|
43
65
|
|
44
|
-
end
|
66
|
+
end
|
45
67
|
|
46
|
-
|
68
|
+
private
|
69
|
+
|
70
|
+
def anykey_press()
|
71
|
+
|
72
|
+
if @keypress_detection and (Time.now > @t2 + @interval) then
|
73
|
+
message 'keypress detected', nil
|
74
|
+
@t2 = Time.now
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
47
78
|
|
48
79
|
def on_control_key()
|
49
80
|
puts 'inside on_control_key' if @debug
|
@@ -74,6 +105,11 @@ class XInputWrapperPlus < XInputWrapper
|
|
74
105
|
puts "on_mousemove() x: %s y: %s" % [x, y]
|
75
106
|
end
|
76
107
|
|
108
|
+
if @motion_detection and (Time.now > @t2 + @interval) then
|
109
|
+
message 'motion detected', nil
|
110
|
+
@t2 = Time.now
|
111
|
+
end
|
112
|
+
=begin
|
77
113
|
@timer.exit if @timer
|
78
114
|
|
79
115
|
@a << [x,y]
|
@@ -88,7 +124,7 @@ class XInputWrapperPlus < XInputWrapper
|
|
88
124
|
@a = []
|
89
125
|
|
90
126
|
end
|
91
|
-
|
127
|
+
=end
|
92
128
|
|
93
129
|
end
|
94
130
|
|
data.tar.gz.sig
CHANGED
Binary file
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,53 @@ 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
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjExMDIwMjE0NTAxWhcN
|
15
|
+
MjIxMDIwMjE0NTA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61WUGAfcg+uq1QeyNubFGp1
|
30
|
+
tNAq4aYRNFISXbbls8ltN4Rc02FiD+qQWKusnJZNV9KKPPTUK80z7krnJ92IG/1X
|
31
|
+
7dD8X2mTlYn/GaEcUdErzFdfUY6W1NhJtpduExV/zQn1cVLyawnqtYXZVNNHs0yn
|
32
|
+
fF4zMYg8zwyC3NoiBsw4ttOafbSKBIsPxdQlte4dGy6dr8PeFEj17BoezHtA4Wy4
|
33
|
+
TyZy0Mz4faHE1ZX8pePjcEfytF8tA4mY5ZSzA9at4AdItmqsXMEs+2Vq1ldHbe4i
|
34
|
+
BSsNM6FTzF8Cs7g66gOjumXRnWXhpndrJ0xgg9eDd+GT4VZd9hrp8c8XhV/G79MQ
|
35
|
+
u085o8gsCVOJC4P40gYteNm1nfOXtueJsOiLWvvwVUPNWEclrXGotC6M9oQ05tIw
|
36
|
+
WRJtwtBTRvaGT4z1I+tAttJt
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
34
39
|
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: ruby-wmctrl
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.0'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.0.8
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.0'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.0.8
|
35
60
|
- !ruby/object:Gem::Dependency
|
36
61
|
name: sps-pub
|
37
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,24 +101,24 @@ dependencies:
|
|
76
101
|
name: xinput_wrapper
|
77
102
|
requirement: !ruby/object:Gem::Requirement
|
78
103
|
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: 0.6.0
|
82
104
|
- - "~>"
|
83
105
|
- !ruby/object:Gem::Version
|
84
|
-
version: '0.
|
106
|
+
version: '0.8'
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.8.1
|
85
110
|
type: :runtime
|
86
111
|
prerelease: false
|
87
112
|
version_requirements: !ruby/object:Gem::Requirement
|
88
113
|
requirements:
|
89
|
-
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: 0.6.0
|
92
114
|
- - "~>"
|
93
115
|
- !ruby/object:Gem::Version
|
94
|
-
version: '0.
|
116
|
+
version: '0.8'
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.8.1
|
95
120
|
description:
|
96
|
-
email:
|
121
|
+
email: digital.robertson@gmail.com
|
97
122
|
executables: []
|
98
123
|
extensions: []
|
99
124
|
extra_rdoc_files: []
|
@@ -118,7 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
143
|
- !ruby/object:Gem::Version
|
119
144
|
version: '0'
|
120
145
|
requirements: []
|
121
|
-
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 2.7.10
|
122
148
|
signing_key:
|
123
149
|
specification_version: 4
|
124
150
|
summary: A wrapper for the Linux utility xinput. Publishes an SPS message whenever
|
metadata.gz.sig
CHANGED
Binary file
|