xinput_wrapper 0.2.3 → 0.3.0

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: bfcd8783533ef00a1af9570118f69bf191a6dd70f19307f10f1434d762401dbc
4
- data.tar.gz: 72608043e08daebced96533173d91b8f06f764f01dedaafa7b3fa09a4c3db93a
3
+ metadata.gz: ac27a60670da5820cc957691a85474ba963d345611df35c10348244272dae29e
4
+ data.tar.gz: 368fef34875b6cc10d7d4b3bf8579b2aa5d63893be67a7070769eb43d64b9038
5
5
  SHA512:
6
- metadata.gz: 7581942d3403f3b775da756468fa90534a697fdbe3ccb1486dd1377cb1d0c95be9d68c5b1366e486ca86da21649e39cdb8a8e26e7c347c95e195d431aa73a53b
7
- data.tar.gz: 9d3ab0efc14c841313586944abbd8c7742dcf5e8f4ed6661ecb276779b174c31d5b28e19b7f7f9c0f3d0673956c70eaffaf8aacad6db14181993d8fd22863bc9
6
+ metadata.gz: '0182e899d596be18ca79f281895bff6969449ecc041a3c74d82c98f0e3a2739675d56e0139357c9ca934bcba580e3a2b4cc46fcc238df821ad62d1dc46bf0a10'
7
+ data.tar.gz: 0c8e5df53df45004ed59aef917cf9357f88c4589134b2f963a846504dc8c71eabda6b6812dbd471c6361346ef8348cf8acc07a452504cf8fd985cc9b0320cb21
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- �](�쵍�:�A=[[��&�-�S��M
2
- T^P���d?��+��O�0����.e��)WnӇwC,�l!oD��>ܺ�G��Z�ٝ2�kcQk���3��N��Q���/�X��M�*�'ny��@9�&�|ė^�U쬛�~�H4���4FSM�$ih��W���8�ga��ɤ۞n@��g�:F-4�*�v���I-LP� ����n%nWT�ϓjr~��󘩟��v�>�:��P�$ؒs^`܋�oA�p�র�)'�+Q}d�L���Op��Hy�bg�g�Y���ǡcp
3
- [�����Y%0]�
4
- �VxV�ct%�d��ڛ���/zX/�i\�Tޙ/D��'�R���~t���<>;�
5
- 4��c%a�L^=Y�
1
+ Sd���DX�ȃ����׍��}ړØ'��>�>������Guzv.�����hA9����-N [��|�C���.)��] c�X�UƔ OT�R{��J0��xhF����L�Z*�&��Qʣ;\9��`�˽t
2
+ e��x��=�AC���,�C!�Iz �N�~7G���x�9�
3
+ a��L^t��&8�gTk�k���\?Ж.6[y<*k� �ƹ.u5��9�<V��dʪM����� rQ�zݱT�6 aCl4�c�zt���TN.钅�
@@ -10,12 +10,20 @@ class XInputWrapper
10
10
 
11
11
  def initialize(device: '3', verbose: true, lookup: {}, debug: false )
12
12
 
13
+ # defaults to QWERTY keyboard layout
14
+
13
15
  @lookup = {
16
+ 10=>:"1", 11=>:"2", 12=>:"3", 13=>:"4", 14=>:"5", 15=>:"6", 16=>:"7",
17
+ 17=>:"8", 18=>:"9", 19=>:"0", 20=>:-, 21=>:"=", 22=>:backspace,
18
+ 23=>:tab, 24=>:q, 25=>:w, 26=>:e, 27=>:r, 28=>:t, 29=>:y, 30=>:u,
19
+ 31=>:i, 32=>:o, 33=>:p, 34=>:"[", 35=>:"]", 36=>nil, 38=>:a, 39=>:s,
20
+ 40=>:d, 41=>:f, 42=>:g, 43=>:h, 44=>:j, 45=>:k, 46=>:l, 47=>:";",
21
+ 48=>:"'", 49=>nil, 52=>:z, 53=>:x, 54=>:c, 55=>:v, 56=>:b, 57=>:n,
22
+ 58=>:m, 59=>:",", 60=>:".", 61=>:/, 62=>:right_shift, 65=>:" ",
14
23
  9 => :escape,
15
24
  37 => :control,
16
- 50 => :shift,
17
- 62 => :shift,
18
- 64 => :alt,
25
+ 50 => :left_shift,
26
+ 64 => :left_alt,
19
27
  66 => :capslock,
20
28
  67 => :f1,
21
29
  68 => :f2,
@@ -29,7 +37,7 @@ class XInputWrapper
29
37
  76 => :f10,
30
38
  77 => :numlock,
31
39
  78 => :scroll_lock,
32
- 92 => :alt,
40
+ 92 => :right_alt,
33
41
  95 => :f11,
34
42
  96 => :f12,
35
43
  105 => :control,
@@ -88,10 +96,11 @@ class XInputWrapper
88
96
 
89
97
  puts 'keycode: ' + keycode.to_s if keycode > 0 and @verbose
90
98
  puts ('>keycode: ' + keycode.to_s).debug if @debug
91
-
92
- on_key_press(keycode)
93
99
 
94
100
  key = @lookup[keycode]
101
+ on_key_press(key, keycode)
102
+
103
+
95
104
  puts ('key: ' + key.inspect).debug if @debug
96
105
 
97
106
  if key then
@@ -109,7 +118,7 @@ class XInputWrapper
109
118
  def on_control_key()
110
119
  puts 'ctrl key pressed'
111
120
  end
112
- def on_key_press(keycode) end
121
+ def on_key_press(key, keycode) end
113
122
 
114
123
  def on_shift_key() end
115
124
  def on_super_key() end
@@ -126,7 +135,15 @@ class XInputWrapper
126
135
  def on_f10_key() end
127
136
  def on_f11_key() end
128
137
  def on_f12_key() end
138
+
139
+ private
140
+
141
+ def on_leftcontrol_key() on_control_key() end
142
+ def on_rightcontrol_key() on_control_key() end
143
+ def on_left_alt_key() on_alt_key() end
144
+ def on_right_alt_key() on_alt_key() end
145
+ def on_left_shift_key() on_shift_key() end
146
+ def on_right_shift_key() on_shift_key() end
129
147
 
130
148
  end
131
149
 
132
- # puts h.sort.map {|x| "%s => :%s" % x}.join(",\n")
data.tar.gz.sig CHANGED
Binary file
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.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  rryowfoo6nLmegcIZjm+zz/gkT/0udwMMVm2gwo0bIRQuQOLmd7IUNzYQKZQOGMA
36
36
  g4ETbI8IEC3VCaoECdunsS3t
37
37
  -----END CERTIFICATE-----
38
- date: 2019-02-10 00:00:00.000000000 Z
38
+ date: 2019-03-15 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.2
86
+ rubygems_version: 3.0.1
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