uinput-keyboard 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 66646a2407860656bcf89b8ae26386c6cdf6df17
4
- data.tar.gz: 528b2aa25eb8decf402b516e64e1b9678cec6f64
3
+ metadata.gz: 39a2acc0faedbe6d57f2b046746dd185fde0cf3e
4
+ data.tar.gz: 63237b2ee8672c9f3b60588fa894f23d861e64db
5
5
  SHA512:
6
- metadata.gz: a8c86e9fc3e12b8b204442c1a9252d41e780c5e083b3ba8e0fd8f2382f1db95b32da00733bde406834104e1b5a8997bbe1f43f7453bea464dea34b262c707e80
7
- data.tar.gz: ca8133c2b8405330430bc33ddefd5c1fef2ab55a2b47527e7832075c02983a630c6bfadce072623f56073bfc28d66f13ba1d119e4eea68a5f618f48467121a03
6
+ metadata.gz: f6a5d69e00cf83ebb14c15ff01716fea7b7e000a9503a949d7b7842242e743a1d5d1e7102ba2aed1b244df883ca643129b88bf03948d116f96f297a590b65b37
7
+ data.tar.gz: 11351658ec058f30ac890ea33dd404c9b9c79229142999c22860d750aaec3a5b48b840d9fa22f47f552d654924c141cc7826fa3fa1c2340af996da69bbd96ded
@@ -20,17 +20,21 @@ module Uinput
20
20
  attr_accessor :keymap
21
21
 
22
22
  def press(*symbols)
23
- symbols_to_keys(*symbols).each do |key|
23
+ keys = symbols_to_keys(*symbols)
24
+ keys.each do |key|
24
25
  send_event(:EV_KEY, key.scan_code, 1)
25
26
  end
26
27
  send_event(:EV_SYN, :SYN_REPORT)
28
+ keys.map(&:code)
27
29
  end
28
30
 
29
31
  def release(*symbols)
30
- symbols_to_keys(*symbols).each do |key|
32
+ keys = symbols_to_keys(*symbols)
33
+ keys.each do |key|
31
34
  send_event(:EV_KEY, key.scan_code, 0)
32
35
  end
33
36
  send_event(:EV_SYN, :SYN_REPORT)
37
+ keys.map(&:code)
34
38
  end
35
39
 
36
40
  def tap(*symbols)
@@ -41,10 +45,12 @@ module Uinput
41
45
  def type(string)
42
46
  # prevent dropped key events (b/c of evdev buffer overflow?) by sending
43
47
  # out the event chain in chunks rather than in one piece
48
+ keycodes = []
44
49
  string_to_symbols(string).each_slice(8) do |symbols|
45
- symbols.each{ |symbol| tap(symbol) }
50
+ keycodes += symbols.flat_map{ |symbol| tap(symbol) }
46
51
  sleep 0.01 # time to breath
47
52
  end
53
+ keycodes
48
54
  end
49
55
 
50
56
  private
@@ -1,3 +1,3 @@
1
1
  module Uinput
2
- Keyboard_VERSION = "0.1.2"
2
+ Keyboard_VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uinput-keyboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.4.8
108
+ rubygems_version: 2.4.5.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Ruby wrapper around uinput to create a virtual keyboard.