fusuma-plugin-keypress 0.8.0 → 0.11.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/README.md +2 -18
- data/fusuma-plugin-keypress.gemspec +4 -3
- data/lib/fusuma/plugin/detectors/keypress_detector.rb +2 -2
- data/lib/fusuma/plugin/events/records/keypress_record.rb +7 -5
- data/lib/fusuma/plugin/filters/keypress_filter.yml +7 -0
- data/lib/fusuma/plugin/keypress/version.rb +1 -1
- data/lib/fusuma/plugin/keypress.rb +6 -6
- data/lib/fusuma/plugin/parsers/keypress_parser.rb +2 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35ab807f66632c961b252e90d2a9a62bb1ede4446da747eb508a49b720e90bf4
|
4
|
+
data.tar.gz: f9265defce2e65bbb8d1f9e48b84a62864edbdd9fa87b2f39ed0818a2ca85037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e4727296863b43a122ea846d464080862af1ad7efb51947c00bde0b6ef037222d8ecef33771c5ab709a2b9b1fcd3216f3b05285970471d43f60be65f01b7cde
|
7
|
+
data.tar.gz: 5f41716f81deac86db9a1038462239ddce120c4d0c6e74bb2c71f11c90d0453461142371b955f383bf341c67c0aede68d79d51fa59aa440879f8c8ff23f3631f
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@ Keyboard + Touchpad combination plugin for [Fusuma](https://github.com/iberianpi
|
|
6
6
|
* Customize gestures with modifier keys
|
7
7
|
* Supports multiple modifier key combinations
|
8
8
|
|
9
|
+
NOTE: **Note: This plugin reads key input from keyboard to identify pressed key and assign it to an action.**
|
10
|
+
|
9
11
|
## Installation
|
10
12
|
|
11
13
|
Run the following code in your terminal.
|
@@ -18,19 +20,6 @@ This plugin requires [Fusuma](https://github.com/iberianpig/fusuma#update) versi
|
|
18
20
|
$ sudo gem install fusuma-plugin-keypress
|
19
21
|
```
|
20
22
|
|
21
|
-
### Add show-keycodes option
|
22
|
-
|
23
|
-
Open `~/.config/fusuma/config.yml` and add the following code at the bottom.
|
24
|
-
|
25
|
-
```yaml
|
26
|
-
plugin:
|
27
|
-
inputs:
|
28
|
-
libinput_command_input:
|
29
|
-
show-keycodes: true
|
30
|
-
```
|
31
|
-
|
32
|
-
**NOTE: fusuma can read your keyboard inputs if show-keycodes option is true**
|
33
|
-
|
34
23
|
## Properties
|
35
24
|
|
36
25
|
### Keypress
|
@@ -70,11 +59,6 @@ swipe:
|
|
70
59
|
command: 'xdotool key --clearmodifiers XF86MonBrightnessDown'
|
71
60
|
LEFTMETA+LEFTALT:
|
72
61
|
command: 'xdotool key --clearmodifiers XF86AudioLowerVolume'
|
73
|
-
|
74
|
-
plugin:
|
75
|
-
inputs:
|
76
|
-
libinput_command_input:
|
77
|
-
show-keycodes: true
|
78
62
|
```
|
79
63
|
|
80
64
|
* Swipe up/down with four fingers while keypress LEFTMETA key to change display brightness.
|
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.required_ruby_version = ">= 2.
|
25
|
-
#
|
26
|
-
|
24
|
+
spec.required_ruby_version = ">= 2.7"
|
25
|
+
# https://packages.ubuntu.com/search?keywords=ruby&searchon=names&exact=1&suite=all§ion=main
|
26
|
+
# support focal (20.04LTS) 2.7
|
27
|
+
spec.add_dependency "fusuma", ">= 3.1"
|
27
28
|
spec.metadata = {
|
28
29
|
"rubygems_mfa_required" => "true"
|
29
30
|
}
|
@@ -70,8 +70,8 @@ module Fusuma
|
|
70
70
|
def create_index(codes:)
|
71
71
|
Config::Index.new(
|
72
72
|
[
|
73
|
-
Config::Index::Key.new("keypress", skippable:
|
74
|
-
Config::Index::Key.new(codes.join("+"), skippable:
|
73
|
+
Config::Index::Key.new("keypress", skippable: false),
|
74
|
+
Config::Index::Key.new(codes.join("+"), skippable: false)
|
75
75
|
]
|
76
76
|
)
|
77
77
|
end
|
@@ -6,21 +6,23 @@ module Fusuma
|
|
6
6
|
module Records
|
7
7
|
# Record for Keypress event
|
8
8
|
class KeypressRecord < Record
|
9
|
-
attr_reader :status, :code
|
9
|
+
attr_reader :status, :code, :layer
|
10
10
|
|
11
11
|
# @example
|
12
|
-
# KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT')
|
12
|
+
# KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT', layer: 'thumbsense')
|
13
13
|
#
|
14
|
-
# @param status [String]
|
14
|
+
# @param status [String] 'pressed' or 'released'
|
15
15
|
# @param code [String]
|
16
|
-
|
16
|
+
# @param layer [Hash] this field will be used from other plugin.
|
17
|
+
def initialize(status:, code:, layer: nil)
|
17
18
|
super()
|
18
19
|
@status = status
|
19
20
|
@code = code
|
21
|
+
@layer = layer
|
20
22
|
end
|
21
23
|
|
22
24
|
def to_s
|
23
|
-
"#{status} #{code}"
|
25
|
+
"#{status} #{code} #{layer}"
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
# fusuma will `require fusuma-plugin-xxxx/plugin/xxxx.rb`
|
4
4
|
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
9
|
-
require_relative "
|
10
|
-
require_relative "
|
5
|
+
require_relative "keypress/version"
|
6
|
+
require_relative "events/records/keypress_record"
|
7
|
+
require_relative "filters/keypress_filter"
|
8
|
+
require_relative "parsers/keypress_parser"
|
9
|
+
require_relative "buffers/keypress_buffer"
|
10
|
+
require_relative "detectors/keypress_detector"
|
@@ -19,9 +19,10 @@ module Fusuma
|
|
19
19
|
# event4 KEYBOARD_KEY +7.52s KEY_CAPSLOCK (58) released
|
20
20
|
# event4 KEYBOARD_KEY +8.98s KEY_LEFTCTRL (29) pressed
|
21
21
|
# event4 KEYBOARD_KEY +9.14s KEY_LEFTCTRL (29) released
|
22
|
+
# event4 KEYBOARD_KEY +29.581s KEY_2 (3) released
|
22
23
|
|
23
24
|
case line
|
24
|
-
when /KEYBOARD_KEY.+(\d+\.\d+)s.*KEY_([
|
25
|
+
when /KEYBOARD_KEY.+(\d+\.\d+)s.*KEY_([[:alnum:]_]+)\s.*(pressed|released)/
|
25
26
|
matched = Regexp.last_match
|
26
27
|
# time = matched[1] # 4.81
|
27
28
|
code = matched[2] # LEFTSHIFT
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusuma-plugin-keypress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fusuma
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.1'
|
27
27
|
description: fusuma-plugin-keypress is Fusuma plugin for keypress combination.
|
28
28
|
email:
|
29
29
|
- yhkyky@gmail.com
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/fusuma/plugin/detectors/keypress_detector.rb
|
41
41
|
- lib/fusuma/plugin/events/records/keypress_record.rb
|
42
42
|
- lib/fusuma/plugin/filters/keypress_filter.rb
|
43
|
+
- lib/fusuma/plugin/filters/keypress_filter.yml
|
43
44
|
- lib/fusuma/plugin/keypress.rb
|
44
45
|
- lib/fusuma/plugin/keypress/version.rb
|
45
46
|
- lib/fusuma/plugin/parsers/keypress_parser.rb
|
@@ -56,14 +57,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
57
|
requirements:
|
57
58
|
- - ">="
|
58
59
|
- !ruby/object:Gem::Version
|
59
|
-
version: 2.
|
60
|
+
version: '2.7'
|
60
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
62
|
requirements:
|
62
63
|
- - ">="
|
63
64
|
- !ruby/object:Gem::Version
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.4.19
|
67
68
|
signing_key:
|
68
69
|
specification_version: 4
|
69
70
|
summary: Keypress plugin for Fusuma
|