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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23d68a2efd5f41fe72149b824d2ccb15d9153b70e177e0c6547c6fdc531d7015
4
- data.tar.gz: 206d32b21db53813a0213aa6efa7f4005132332ad06f5d360bb57aed291bd61c
3
+ metadata.gz: e1f133065105c5e8bcdc9dd04873d6245cb3b6357a1a9f45a437cd0150b5a959
4
+ data.tar.gz: c6f759e41f007688902c837f1fedc65e00d70ee3a41bb8bc9baf28de48e3c8ed
5
5
  SHA512:
6
- metadata.gz: d8565fdb87ae1ed53a903587c45fc529b780983e845be2f81601e72160244de3852fdc63d8d1f9960cb20c30b82e86713a4c56c393064cf67e04548f1c187323
7
- data.tar.gz: 84f81cc005e1cfe105844f0108241a8e4c2c99f454a2ae5dbfa52023c4c094efb534f87f7c6f6705647b5f4fd556387c8d3ef6def58a6141c39cc94faa6dd6a2
6
+ metadata.gz: 6390589b886bc137bed6e4bbd4cab68b890d7660fbf09462aa471557c8c7533cff11f73cec2f25ce3875489ef3abd44e82999af2f400dbe619470f29e4d2e17b
7
+ data.tar.gz: 4f80040d29ff16b5184e2f2f51485e39e178a029da0aec8e2c647da9428bd08ab54f5814c49194eeccdfac012091e4235392768d02de71191fff8af3b9bf4f4f
@@ -11,3 +11,10 @@ Metrics/LineLength:
11
11
  Max: 100
12
12
  Exclude:
13
13
  - "fusuma-plugin-*.gemspec"
14
+
15
+ Style/HashEachMethods:
16
+ Enabled: true
17
+ Style/HashTransformKeys:
18
+ Enabled: true
19
+ Style/HashTransformValues:
20
+ Enabled: true
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
- * Emulate keyboard events with evdev
6
- * This plugin is wayland compatible and alternative to xdotool
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` can send multiple key events
35
- * Combine keys for pressing the same time with `+`
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,7 +10,7 @@ module Fusuma
10
10
  end
11
11
 
12
12
  def path
13
- raise 'Keyboard is not found' if @evdev.nil?
13
+ raise 'Device path is not found' if @evdev.nil?
14
14
 
15
15
  @path ||= @evdev.file.path
16
16
  end
@@ -10,19 +10,18 @@ module Fusuma
10
10
  module Sendkey
11
11
  # Emulate Keyboard
12
12
  class Keyboard
13
- def initialize(name_pattern: nil)
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
- attr_writer :device
24
+ attr_reader :device
26
25
 
27
26
  # @param param [String]
28
27
  def type(param:)
@@ -3,7 +3,7 @@
3
3
  module Fusuma
4
4
  module Plugin
5
5
  module Sendkey
6
- VERSION = '0.4.0'
6
+ VERSION = '0.5.0'
7
7
  end
8
8
  end
9
9
  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.4.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-03-25 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusuma