fusuma-plugin-keypress 0.6.1 → 0.7.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: d551f984dfdbac5d6095387156cf211450a23e45701737713cc5c5be261081d2
4
- data.tar.gz: e3446a313462ad562e0dd4eabb112c1e3d39735523315c0e34f90c51b12ad655
3
+ metadata.gz: 6e5973d79e56fb0bb392e526f800f5d644534617404bfcaf5ef7db82f8e55a0f
4
+ data.tar.gz: '08e17845c7d60fb47e5b679a030f9bbccbf02a035269965ec78d1fc39958d1fc'
5
5
  SHA512:
6
- metadata.gz: 69a1272b0938d590b72d8b94fcab0d37fdb6af71111e936e1e817a8acffca0c05a9907795027e796d081731a605b719e8999125d0124cb657996d95379340dd8
7
- data.tar.gz: 7e26101b157dd1fcef0d061c3666a9c23402434667054a98e829f9969f8f1391e3c8c108d49220a7e8b9433b831b6507a4b543cbdb5a5c4b1334b456621292ea
6
+ metadata.gz: 5416a456b626728f37ffbc3ff82ab608a09e24e712304080a90352bd13430c409267248505753d939ec499763ada1e53ba69227ea77497c8c657b49962d7dd47
7
+ data.tar.gz: f17b639d87ab04d2996230c8453c780a45de736d2e86aa1edbceaf662db3d3777e3ccd9bd6a3902825834a6940de871c1554fc5ff05416d63fbb14d8abe3c146
data/README.md CHANGED
@@ -77,7 +77,7 @@ plugin:
77
77
  show-keycodes: true
78
78
  ```
79
79
 
80
- * Swipe up/down with four fingers while keypress LEFTMETA key to change display brightnes .
80
+ * Swipe up/down with four fingers while keypress LEFTMETA key to change display brightness.
81
81
  * Swipe up/down with four fingers while keypress LEFTMETA and LEFTALT keys to change audio volume.
82
82
  - If you want to combine a gesture with two keys, combine modifier keys with `+`
83
83
 
data/bin/console CHANGED
@@ -2,12 +2,14 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
+ require "irb"
6
+
5
7
  require 'fusuma'
8
+ Fusuma::Plugin::Manager.require_base_plugins
6
9
  require 'fusuma/plugin/keypress'
7
10
 
8
11
  # You can add fixtures and/or initialization code here to make experimenting
9
12
  # with your gem easier. You can also use a different console, if you like.
10
13
 
11
14
  # (If you use this, don't forget to add pry to your Gemfile!)
12
- require 'pry'
13
- Pry.start
15
+ IRB.start
@@ -7,6 +7,12 @@ module Fusuma
7
7
  class KeypressBuffer < Buffer
8
8
  DEFAULT_SOURCE = "keypress_parser"
9
9
 
10
+ def config_param_types
11
+ {
12
+ source: [String]
13
+ }
14
+ end
15
+
10
16
  # @param event [Event]
11
17
  def buffer(event)
12
18
  return if event&.tag != source
@@ -8,11 +8,19 @@ module Fusuma
8
8
  class KeypressRecord < Record
9
9
  attr_reader :status, :code
10
10
 
11
+ # @example
12
+ # KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT')
13
+ #
11
14
  # @param status [String]
15
+ # @param code [String]
12
16
  def initialize(status:, code:)
17
+ super()
13
18
  @status = status
14
19
  @code = code
15
- super()
20
+ end
21
+
22
+ def to_s
23
+ "#{status} #{code}"
16
24
  end
17
25
  end
18
26
  end
@@ -49,7 +49,7 @@ module Fusuma
49
49
  def select
50
50
  if @names
51
51
  Fusuma::Device.all.select do |d|
52
- Array(config_params(:keep_device_names)).any? do |name|
52
+ Array(@names).any? do |name|
53
53
  d.name =~ name
54
54
  end
55
55
  end
@@ -3,7 +3,7 @@
3
3
  module Fusuma
4
4
  module Plugin
5
5
  module Keypress
6
- VERSION = "0.6.1"
6
+ VERSION = "0.7.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-keypress
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-18 00:00:00.000000000 Z
11
+ date: 2023-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusuma