xinput_wrapper 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/xinput_wrapper.rb +43 -6
- metadata +48 -25
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a24ab7897e3416a06b5b2df32d3fd420a469c707a20512e6d64d276003ceef67
|
4
|
+
data.tar.gz: 199d0880d8a1caf1e74d3abec562e495b134c7a3ab3d60eae014ade04321d8ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 738ea16256987b2e8b52e8f4ebc9639a7e7c77780631e5d3b1dc0b34bbdffca0bb3ed7041ab120f80c5498a9026b1deea76a16914c3457aaaf1106e39448511a
|
7
|
+
data.tar.gz: c024e544445cca37136217809ca940c125577fad40f77c637b1c3794a5810cc833056fbaa0d7813d67d2cf34606f6217c1bac0aba98bb3309ed5305ac76a5af7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/xinput_wrapper.rb
CHANGED
@@ -2,16 +2,21 @@
|
|
2
2
|
|
3
3
|
# file: xinput_wrapper.rb
|
4
4
|
|
5
|
+
require 'c32'
|
5
6
|
|
6
7
|
|
7
8
|
class XInputWrapper
|
9
|
+
using ColouredText
|
8
10
|
|
9
11
|
def initialize(device: '3', verbose: true, lookup: {}, debug: false )
|
10
12
|
|
11
13
|
@lookup = {
|
12
|
-
|
14
|
+
9 => :escape
|
15
|
+
37 => :control,
|
13
16
|
50 => :shift,
|
14
17
|
62 => :shift,
|
18
|
+
64 => :alt,
|
19
|
+
66 => :capslock,
|
15
20
|
67 => :f1,
|
16
21
|
68 => :f2,
|
17
22
|
69 => :f3,
|
@@ -22,11 +27,40 @@ class XInputWrapper
|
|
22
27
|
74 => :f8,
|
23
28
|
75 => :f9,
|
24
29
|
76 => :f10,
|
30
|
+
77 => :numlock,
|
31
|
+
78 => :scroll_lock,
|
32
|
+
92 => :alt,
|
25
33
|
95 => :f11,
|
26
|
-
96 => :f12,
|
34
|
+
96 => :f12,
|
27
35
|
105 => :control,
|
36
|
+
107 => :print_screen,
|
37
|
+
110 => :home,
|
38
|
+
111 => :up_arrow,
|
39
|
+
112 => :pgup,
|
40
|
+
113 => :left_arrow,
|
41
|
+
114 => :right_arrow,
|
42
|
+
115 => :end,
|
43
|
+
116 => :down_arrow,
|
44
|
+
117 => :pgdown,
|
45
|
+
121 => :mute,
|
46
|
+
122 => :vol_down,
|
47
|
+
123 => :vol_up,
|
48
|
+
127 => :pause_break,
|
28
49
|
133 => :super,
|
29
|
-
134 => :super
|
50
|
+
134 => :super,
|
51
|
+
135 => :submenu,
|
52
|
+
148 => :calc,
|
53
|
+
150 => :sleep,
|
54
|
+
151 => :wakeup,
|
55
|
+
163 => :email,
|
56
|
+
166 => :go_back,
|
57
|
+
167 => :go_forward,
|
58
|
+
171 => :next_track,
|
59
|
+
172 => :play_stop,
|
60
|
+
173 => :prev_track,
|
61
|
+
174 => :stop,
|
62
|
+
179 => :music,
|
63
|
+
180 => :browser
|
30
64
|
}.merge(lookup)
|
31
65
|
|
32
66
|
@device, @verbose, @debug = device, verbose, debug
|
@@ -53,16 +87,17 @@ class XInputWrapper
|
|
53
87
|
next if keycode == 0
|
54
88
|
|
55
89
|
puts 'keycode: ' + keycode.to_s if keycode > 0 and @verbose
|
56
|
-
puts '>keycode: ' + keycode.to_s if @debug
|
90
|
+
puts ('>keycode: ' + keycode.to_s).debug if @debug
|
57
91
|
|
58
92
|
on_key_press(keycode)
|
59
93
|
|
60
94
|
key = @lookup[keycode]
|
61
|
-
puts 'key: ' + key.inspect if @debug
|
95
|
+
puts ('key: ' + key.inspect).debug if @debug
|
62
96
|
|
63
97
|
if key then
|
64
98
|
puts key.to_s + ' key presssed' if @verbose
|
65
|
-
|
99
|
+
name = "on_#{key}_key".to_sym
|
100
|
+
method(name).call if self.respond_to? name
|
66
101
|
end
|
67
102
|
|
68
103
|
end
|
@@ -91,3 +126,5 @@ class XInputWrapper
|
|
91
126
|
def on_f12_key() end
|
92
127
|
|
93
128
|
end
|
129
|
+
|
130
|
+
# puts h.sort.map {|x| "%s => :%s" % x}.join(",\n")
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,29 +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
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMjEwMTU1NTM1WhcN
|
15
|
+
MjAwMjEwMTU1NTM1WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQD2pELS
|
17
|
+
hfHN+He5s77qpnUO4j6GDr1B9PDIKqJDBz+kJCUGXsLzyHnKK8iIblXtETyIJn9F
|
18
|
+
euzS6ohPh64xfBcKrnF7bSUAXsdC/P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+
1aSaQX/s+LpAVRGJlWrVa+uQ21aUdItSdkKaRNK4MxQHPu8s/9sgeZRMEO5wJc7i
|
34
|
+
bvgBqmvgsZwFmSRWE1K/PusL86uaYCw5pTWA+BquQ7taMwhGKqdDlHLp+SQ1Wd82
|
35
|
+
rryowfoo6nLmegcIZjm+zz/gkT/0udwMMVm2gwo0bIRQuQOLmd7IUNzYQKZQOGMA
|
36
|
+
g4ETbI8IEC3VCaoECdunsS3t
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
35
|
-
dependencies:
|
38
|
+
date: 2019-02-10 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: c32
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.1.2
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.1'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.1.2
|
36
60
|
description:
|
37
61
|
email: james@jamesrobertson.eu
|
38
62
|
executables: []
|
@@ -59,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
83
|
- !ruby/object:Gem::Version
|
60
84
|
version: '0'
|
61
85
|
requirements: []
|
62
|
-
|
63
|
-
rubygems_version: 2.6.13
|
86
|
+
rubygems_version: 3.0.2
|
64
87
|
signing_key:
|
65
88
|
specification_version: 4
|
66
89
|
summary: A wrapper for the Linux utility xinput.
|
metadata.gz.sig
CHANGED
Binary file
|