fusuma-plugin-sendkey 0.6.3 → 0.6.4
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
- data/lib/fusuma/plugin/sendkey/keyboard.rb +10 -4
- data/lib/fusuma/plugin/sendkey/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0d16b0e0388ece2a4315f7c7750d7c94bf838f9cbdd6637804fc7b288963b5
|
4
|
+
data.tar.gz: 44af0181708e6556ebddea600e61fbe23b53ac6816dd4939d572eafa83b9000c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fc15b8f4242f9914c0b07e318711dfb8f7d82e3522817f9c7d59352938aa244c7bbb542c491dcd4d949207f019a84f46821c81ecfa1dc99bd1fcb61a6fc63cf
|
7
|
+
data.tar.gz: 73bd090d983315fa128c18ed61f7a293c5ba805064ae06c801472295b75913540ca7e15bf46bee27a84d1f32fea63e42b4310fad6198b378ad3c8ee28aeeea94
|
@@ -10,6 +10,8 @@ module Fusuma
|
|
10
10
|
module Sendkey
|
11
11
|
# Emulate Keyboard
|
12
12
|
class Keyboard
|
13
|
+
INTERVAL = 0.01
|
14
|
+
|
13
15
|
MODIFIER_KEY_CODES = %w[
|
14
16
|
KEY_CAPSLOCK
|
15
17
|
KEY_LEFTALT
|
@@ -45,11 +47,11 @@ module Fusuma
|
|
45
47
|
def type(param:)
|
46
48
|
return unless param.is_a?(String)
|
47
49
|
|
48
|
-
|
49
|
-
clear_modifiers(MODIFIER_KEY_CODES -
|
50
|
-
|
50
|
+
keycodes = split_param(param)
|
51
|
+
clear_modifiers(MODIFIER_KEY_CODES - keycodes)
|
52
|
+
keycodes.each { |keycode| key_event(keycode: keycode, press: true) && wait }
|
51
53
|
key_sync(press: true)
|
52
|
-
|
54
|
+
keycodes.reverse.each { |keycode| key_event(keycode: keycode, press: false) && wait }
|
53
55
|
key_sync(press: false)
|
54
56
|
end
|
55
57
|
|
@@ -133,6 +135,10 @@ module Fusuma
|
|
133
135
|
def remove_prefix(keycode)
|
134
136
|
keycode.gsub('KEY_', '')
|
135
137
|
end
|
138
|
+
|
139
|
+
def wait
|
140
|
+
sleep(INTERVAL)
|
141
|
+
end
|
136
142
|
end
|
137
143
|
end
|
138
144
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusuma-plugin-sendkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fusuma
|
@@ -66,7 +66,7 @@ homepage: https://github.com/iberianpig/fusuma-plugin-sendkey
|
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
metadata: {}
|
69
|
-
post_install_message:
|
69
|
+
post_install_message:
|
70
70
|
rdoc_options: []
|
71
71
|
require_paths:
|
72
72
|
- lib
|
@@ -81,13 +81,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
85
|
-
signing_key:
|
84
|
+
rubygems_version: 3.2.22
|
85
|
+
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Fusuma plugin to send keyboard events
|
88
88
|
test_files:
|
89
|
-
- spec/fusuma/plugin/sendkey_spec.rb
|
90
|
-
- spec/fusuma/plugin/sendkey/keyboard_spec.rb
|
91
89
|
- spec/fusuma/plugin/executors/sendkey_executor_spec.rb
|
90
|
+
- spec/fusuma/plugin/sendkey/keyboard_spec.rb
|
91
|
+
- spec/fusuma/plugin/sendkey_spec.rb
|
92
92
|
- spec/helpers/config_helper.rb
|
93
93
|
- spec/spec_helper.rb
|