xinput_wrapper 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 9e4522c710fedfbd87d06378e9e3833ac5c1ed33ea8f39b2f7626b028c81e787
4
- data.tar.gz: a5cabb6c182af563bb98dc1dce22b56ddda54c22552ac0a20b2e0b9e83b90f3e
3
+ metadata.gz: 7685727622dac6285e86dcf8095525fde1d6d129b7f210aed3ad2512138efdaa
4
+ data.tar.gz: f404c6286c440432f6b9ad26db6f8b6d36fc6e3ea0d6141baa439bf74c572e16
5
5
  SHA512:
6
- metadata.gz: d824a72ef9e9752631513d260204c81e397036e5e1c99822c2ea95a02375f059191cc89021e9999ef52db4d969b2a65ff85f5fbc6fa0344cf4a0d48cf26314a7
7
- data.tar.gz: 6d9528dd576ba565fec74bcf2d305304a882785b336d8e85b2b44df657b697a0cd3ee45c4fb914e1b0a4d2587b3075b5d3bc2d37edb0267995bf4df65edd76e6
6
+ metadata.gz: 9ce3aaf5e903c982201b1ac8802b109f8388083b0e9f0de02454811e4300069a043b84a6bdf66db2604c70dec57c3a0564747d908beadf2b0216d49e4b9b0dd2
7
+ data.tar.gz: 9c2ae2545e99ba3d1a13789f5d7c24c11b15011f7a623169b1a7bfee9883a88091fcf9d182ead686df0564e9bdd384b0f8918f40f9a0374aca2f08c8a5533c1d
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,6 +2,12 @@
2
2
 
3
3
  # file: xinput_wrapper.rb
4
4
 
5
+ # Captures keyboard or mouse events using program xinput.
6
+
7
+
8
+ # note: To display a list of xinput devices, run the
9
+ # xinput program without any options.
10
+
5
11
  require 'c32'
6
12
 
7
13
 
@@ -13,7 +19,14 @@ RAWKEY_RELEASE = 14
13
19
  class XInputWrapper
14
20
  using ColouredText
15
21
 
16
- def initialize(device: '3', verbose: true, lookup: {}, debug: false )
22
+ # device list:
23
+ # 3 = Virtual core keyboard
24
+ # 4 = Virtual core XTEST pointer (active when using VNC)
25
+ # 5 = Virtual core XTEST keyboard (active when using VNC)
26
+ # 10 = USB Optical Mouse (locally attached)
27
+ # 11 = Microsoft Wired Keyboard 600 (locally attached)
28
+ #
29
+ def initialize(device: nil, verbose: true, lookup: {}, debug: false )
17
30
 
18
31
  # defaults to QWERTY keyboard layout
19
32
  @modifiers = {
@@ -83,7 +96,7 @@ class XInputWrapper
83
96
  end
84
97
 
85
98
  def listen()
86
-
99
+
87
100
  command = "xinput test-xi2 --root #{@device}"
88
101
 
89
102
  type = 0
@@ -93,7 +106,7 @@ class XInputWrapper
93
106
 
94
107
  IO.popen(command).each_line do |x|
95
108
 
96
- #print "GOT ", x
109
+ print "GOT ", x
97
110
  if x[/EVENT type \d \(Motion\)/] and (Time.now > (t1 + 0.06125)) then
98
111
 
99
112
  type = x[/EVENT type (\d+)/,1].to_i
@@ -238,7 +251,7 @@ class XInputWrapper
238
251
  puts 'ctrl key pressed'
239
252
  end
240
253
 
241
- def on_key_press(key, keycode, modifier)
254
+ def on_key_press(key, keycode, modifier=nil)
242
255
 
243
256
  if @debug then
244
257
  puts ('key: ' + key.inspect).debug
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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,31 +11,31 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMjEwMTU1NTM1WhcN
15
- MjAwMjEwMTU1NTM1WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQU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quQ7taMwhGKqdDlHLp+SQ1Wd82
35
- rryowfoo6nLmegcIZjm+zz/gkT/0udwMMVm2gwo0bIRQuQOLmd7IUNzYQKZQOGMA
36
- g4ETbI8IEC3VCaoECdunsS3t
28
+ BgkqhkiG9w0BAQsFAAOCAYEAXg+9mfaTHPcbez7P0XnwGL0C4zdPwHtBUXioPwjP
29
+ okklRkFzMQnxArm8U9557g8cXY//vKp/cFBdCExE8lLxAOB9gHswJju0g99Yx7gY
30
+ iEV3TWv5qkLQ+n8zdTd8TxEyjWB6ZXOJcE+/cTq9Ly1j4bhf9QTdul02TBukEp6d
31
+ opP5/Yvt1GX0ED98olew/pm+KoKKNkcJzSgEH44O+pCfTi4h2STOFRvXVYaB3AH8
32
+ hpuUFcbxzPhBxOChGPAGZLaf7zurw8B2Q1vP75RV9gJ1M6NKU6Hlb6vMJQ3jz8qv
33
+ GIVFoKMCcJH2EImrG47doRVhQPIlxfz7d3f+FdYgnp7wtuFi/byklu1D2G8ZE8Ax
34
+ 1s9Njv/guBMNkw+RV6IlpMtT0yeVvHeYTt0tPKeyrtBrSfsexA3393T7To6Ms+1s
35
+ B//EUqLB2VKtMmcrYMc2FfbLwllNLY4TRq+/lgVLoDb7oLHsiggYSLZS6lPBIQj/
36
+ YnYsDKwN5siDA79sB0fqq2ml
37
37
  -----END CERTIFICATE-----
38
- date: 2019-05-08 00:00:00.000000000 Z
38
+ date: 2020-08-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: c32
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.0.1
86
+ rubygems_version: 3.0.3
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: A wrapper for the Linux utility xinput.
metadata.gz.sig CHANGED
Binary file