fusuma-plugin-keypress 0.6.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d551f984dfdbac5d6095387156cf211450a23e45701737713cc5c5be261081d2
4
- data.tar.gz: e3446a313462ad562e0dd4eabb112c1e3d39735523315c0e34f90c51b12ad655
3
+ metadata.gz: dd49bdce1d44e7fcfed983d3888625bc80e1b383c6d11eac2b7d834913150bd7
4
+ data.tar.gz: 7caeb1d2569e2f9e6dbf65b45a67abdb656387b415bfe7ada2c0195f24a11223
5
5
  SHA512:
6
- metadata.gz: 69a1272b0938d590b72d8b94fcab0d37fdb6af71111e936e1e817a8acffca0c05a9907795027e796d081731a605b719e8999125d0124cb657996d95379340dd8
7
- data.tar.gz: 7e26101b157dd1fcef0d061c3666a9c23402434667054a98e829f9969f8f1391e3c8c108d49220a7e8b9433b831b6507a4b543cbdb5a5c4b1334b456621292ea
6
+ metadata.gz: a17e0f4a0bc4fdb520ec775ca9d8cc9ce776b3fb2f54e4c56eaa99effafd1164c8986e6f9f03974262660a5639bc7fc573beb0de74bd78cdba07772a1c2c7882
7
+ data.tar.gz: 9285228a3a85fd6c4bfd5b9f9b732b537d14ab4f89a15d65cb03ae64672fc61da21b6720807e2072b2378f0e811f7e34b8cf68fb9bc54a48db9d422e60b43202
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Fusuma::Plugin::Keypress [![Gem Version](https://badge.fury.io/rb/fusuma-plugin-keypress.svg)](https://badge.fury.io/rb/fusuma-plugin-keypress) [![Build Status](https://github.com/iberianpig/fusuma-plugin-keypress/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/iberianpig/fusuma-plugin-keypress/actions/workflows/ubuntu.yml)
1
+ # Fusuma::Plugin::Keypress [![Gem Version](https://badge.fury.io/rb/fusuma-plugin-keypress.svg)](https://badge.fury.io/rb/fusuma-plugin-keypress) [![Build Status](https://github.com/iberianpig/fusuma-plugin-keypress/actions/workflows/main.yml/badge.svg)](https://github.com/iberianpig/fusuma-plugin-keypress/actions/workflows/main.yml)
2
2
 
3
3
 
4
4
  Keyboard + Touchpad combination plugin for [Fusuma](https://github.com/iberianpig/fusuma)
@@ -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
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.required_ruby_version = ">= 2.5.1" # https://packages.ubuntu.com/search?keywords=ruby&searchon=names&exact=1&suite=all&section=main
25
25
  # support bionic (18.04LTS) 2.5.1
26
- spec.add_dependency "fusuma", "~> 2.0"
26
+ spec.add_dependency "fusuma", ">= 2.0"
27
27
  spec.metadata = {
28
28
  "rubygems_mfa_required" => "true"
29
29
  }
@@ -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.8.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,27 +1,27 @@
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.8.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-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusuma
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
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
26
  version: '2.0'
27
27
  description: fusuma-plugin-keypress is Fusuma plugin for keypress combination.