keyboard_map 0.1.1 → 0.1.2

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: 7f312919ed805b51ea0fb84ca84af658d8f790f39f8c4f03ddf757ba91c1ffe9
4
- data.tar.gz: 8ab6d0f7568197bf1a0880903ec01f64c7c6b301b2ad2f6e370f3783d3ad15bc
3
+ metadata.gz: 73f42043d059844447e80fadb95e205f0322d878d6916adb150bb884422b9ea6
4
+ data.tar.gz: 116ca240612ee19ceb90b8541364cae3fba201998c9cff9a74688959b8c2037d
5
5
  SHA512:
6
- metadata.gz: 3a49284ca89bd369926a3979ec168ce6b4da91f053ae4ede3c1ae32b59138bfab33c73ce53312d44012a47b4a43aa20e7b9864967db75be7c553b77446b70332
7
- data.tar.gz: 62ff772c4d5c8ace33ff0b0d3a80518364a36436e9bda01afeafba243275562572771a3829b91756caa0e5703b0616f7c472db17af807ed92f789778bfbe5c51
6
+ metadata.gz: a95f1a9d85e9ee5313f2251801c64bf026f21b7fd5c2f18ba4f4627481c311b0f63bbfdbfe51db6b66b770ca154dcdc2dc6eff872dfb7e0ffc24f3b0adde1777
7
+ data.tar.gz: be940b88650dd017a2bdb66b86e7c6f6e6b326830572c60249e4c00f0d3f393d7e5b3aa6e570df997ee077c37e7e138de9d2e3a30306497c6b65ecf4ed054632
@@ -1,3 +1,3 @@
1
1
  class KeyboardMap
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/keyboard_map.rb CHANGED
@@ -8,12 +8,12 @@ class KeyboardMap
8
8
  attr_reader :buf
9
9
 
10
10
  class Event
11
- attr_reader :modifiers,:key
11
+ attr_reader :modifiers,:key, :args
12
12
 
13
-
14
- def initialize(key,*modifiers)
13
+ def initialize(key, *modifiers, args: nil)
15
14
  @modifiers = Set[*modifiers.map(&:to_sym)]
16
15
  @key = key
16
+ @args = args
17
17
  end
18
18
 
19
19
  def to_sym
@@ -151,6 +151,8 @@ class KeyboardMap
151
151
  if key
152
152
  modifiers = map_modifiers(params[1])
153
153
  end
154
+ elsif final == "m" || final == "M" # Mouse reporting
155
+ return Event.new(final == "M" ? :mouse_down : :mouse_up, args: [params[0][1..-1].to_i, params[1].to_i, params[2].to_i])
154
156
  else
155
157
  key = CSI_BASIC_MAP[final]
156
158
  modifiers = map_modifiers(params[1]) if key && params.first == "1" && params.size == 2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyboard_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-16 00:00:00.000000000 Z
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.7.6
93
+ rubygems_version: 3.1.4
95
94
  signing_key:
96
95
  specification_version: 4
97
96
  summary: Read characters from the console and map special keys to symbols