fusuma-plugin-sendkey 0.4.0 → 0.5.0
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/.rubocop.yml +7 -0
- data/README.md +36 -5
- data/lib/fusuma/plugin/sendkey/device.rb +1 -1
- data/lib/fusuma/plugin/sendkey/keyboard.rb +3 -4
- data/lib/fusuma/plugin/sendkey/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1f133065105c5e8bcdc9dd04873d6245cb3b6357a1a9f45a437cd0150b5a959
|
4
|
+
data.tar.gz: c6f759e41f007688902c837f1fedc65e00d70ee3a41bb8bc9baf28de48e3c8ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6390589b886bc137bed6e4bbd4cab68b890d7660fbf09462aa471557c8c7533cff11f73cec2f25ce3875489ef3abd44e82999af2f400dbe619470f29e4d2e17b
|
7
|
+
data.tar.gz: 4f80040d29ff16b5184e2f2f51485e39e178a029da0aec8e2c647da9428bd08ab54f5814c49194eeccdfac012091e4235392768d02de71191fff8af3b9bf4f4f
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
[Fusuma](https://github.com/iberianpig/fusuma) plugin to send keyboard events
|
4
4
|
|
5
|
-
*
|
6
|
-
*
|
5
|
+
* Low-latency key event emulation with evdev
|
6
|
+
* Alternative to xdotool available for X11 and Wayland
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -11,8 +11,9 @@ Run the following code in your terminal.
|
|
11
11
|
|
12
12
|
### Install dependencies
|
13
13
|
|
14
|
+
**NOTE: If you have installed ruby by apt, you must install ruby-dev.**
|
14
15
|
```sh
|
15
|
-
$ sudo apt-get install libevdev-dev
|
16
|
+
$ sudo apt-get install libevdev-dev ruby-dev
|
16
17
|
```
|
17
18
|
|
18
19
|
### Install fusuma-plugin-sendkey
|
@@ -27,18 +28,28 @@ $ sudo gem install fusuma-plugin-sendkey
|
|
27
28
|
```sh
|
28
29
|
$ fusuma-sendkey -l
|
29
30
|
```
|
31
|
+
If you want to look up a specific key, like the next song or the previous song, the `grep -i` refinement search is useful.
|
32
|
+
|
33
|
+
```sh
|
34
|
+
$ fusuma-sendkey -l | grep -i song
|
35
|
+
NEXTSONG
|
36
|
+
PREVIOUSSONG
|
37
|
+
```
|
30
38
|
|
31
39
|
## Run fusuma-sendkey on Terminal
|
32
40
|
|
33
41
|
* `fusuma-sendkey` command is available on your terminal
|
34
|
-
* `fusuma-sendkey`
|
35
|
-
|
42
|
+
* `fusuma-sendkey` supports modifier keys and multiple key presses.
|
43
|
+
Combine keys for pressing the same time with `+`
|
36
44
|
|
37
45
|
|
38
46
|
```sh
|
39
47
|
$ fusuma-sendkey LEFTCTRL+T # press ctrl key + t key
|
40
48
|
```
|
41
49
|
|
50
|
+
Some of the keys found with `fusuma-sendkey -l` may actually be invalid keys.
|
51
|
+
So test it once with `fusuma-sendkey <KEYCODE>` and then add it to config.yml.
|
52
|
+
|
42
53
|
|
43
54
|
## Add sendkey properties to config.yml
|
44
55
|
|
@@ -59,6 +70,26 @@ swipe:
|
|
59
70
|
sendkey: "LEFTCTRL+W" # close tab
|
60
71
|
```
|
61
72
|
|
73
|
+
|
74
|
+
### Specify keyboard by device name
|
75
|
+
|
76
|
+
If you got following error message, try to set your keyboard name to `plugin.executors.sendkey_executor.device_name` on config.yml
|
77
|
+
|
78
|
+
```shell
|
79
|
+
$ fusuma-sendkey -l
|
80
|
+
sendkey: Keyboard: /keyboard|Keyboard|KEYBOARD/ is not found
|
81
|
+
```
|
82
|
+
|
83
|
+
Set the following options to recognize keyboard only for the specified keyboard device.
|
84
|
+
Open `~/.config/fusuma/config.yml` and add the following code at the bottom.
|
85
|
+
|
86
|
+
```yaml
|
87
|
+
plugin:
|
88
|
+
executors:
|
89
|
+
sendkey_executor:
|
90
|
+
device_name: 'YOUR KEYBOARD NAME'
|
91
|
+
```
|
92
|
+
|
62
93
|
## Contributing
|
63
94
|
|
64
95
|
Bug reports and pull requests are welcome on GitHub at https://github.com/iberianpig/fusuma-plugin-sendkey. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
@@ -10,19 +10,18 @@ module Fusuma
|
|
10
10
|
module Sendkey
|
11
11
|
# Emulate Keyboard
|
12
12
|
class Keyboard
|
13
|
-
def initialize(name_pattern:
|
14
|
-
name_pattern ||= 'keyboard'
|
13
|
+
def initialize(name_pattern: 'keyboard|Keyboard|KEYBOARD')
|
15
14
|
device = find_device(name_pattern: name_pattern)
|
16
15
|
|
17
16
|
if device.nil?
|
18
|
-
warn "sendkey: Keyboard /#{name_pattern}/ is not found"
|
17
|
+
warn "sendkey: Keyboard: /#{name_pattern}/ is not found"
|
19
18
|
exit(1)
|
20
19
|
end
|
21
20
|
|
22
21
|
@device = Device.new(path: "/dev/input/#{device.id}")
|
23
22
|
end
|
24
23
|
|
25
|
-
|
24
|
+
attr_reader :device
|
26
25
|
|
27
26
|
# @param param [String]
|
28
27
|
def type(param:)
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fusuma
|