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 +4 -4
- data/lib/keyboard_map/version.rb +1 -1
- data/lib/keyboard_map.rb +5 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73f42043d059844447e80fadb95e205f0322d878d6916adb150bb884422b9ea6
|
4
|
+
data.tar.gz: 116ca240612ee19ceb90b8541364cae3fba201998c9cff9a74688959b8c2037d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95f1a9d85e9ee5313f2251801c64bf026f21b7fd5c2f18ba4f4627481c311b0f63bbfdbfe51db6b66b770ca154dcdc2dc6eff872dfb7e0ffc24f3b0adde1777
|
7
|
+
data.tar.gz: be940b88650dd017a2bdb66b86e7c6f6e6b326830572c60249e4c00f0d3f393d7e5b3aa6e570df997ee077c37e7e138de9d2e3a30306497c6b65ecf4ed054632
|
data/lib/keyboard_map/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
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
|