hidg0 0.2.0 → 0.2.1

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: 3968ff02b8a99ba1837e6e7598f0b1d99c3c738ada9be7c53a0d037f479fea15
4
- data.tar.gz: '08f7b7a6d7b17537fa0db2ddc0d89c13c096a057fc0d97107613e89686b4f878'
3
+ metadata.gz: e0a81b3ba765e28c93311ce860ba1078694524a1af92f5b153818e96e414468d
4
+ data.tar.gz: c6be149a743fc2a1a5960fc5ffe22c44b5feb29a76770ccec5fcad6b9d9eead9
5
5
  SHA512:
6
- metadata.gz: afe1e6b432ad45aa38f13069f8c274798c2b569bc938194f185b5cdf9f72165b7c44056cdb97be30cc542f264310ced174248ada2358f254ac1566df3b9fabdc
7
- data.tar.gz: b66d2525c14325a7784c3414c89a32408b821c0ebc409d00490b0df9e5c10f66d54977a629706426402db3b9f75475ed8e6ac0bf2f5c428c3e63bf40cc8ea556
6
+ metadata.gz: f5dce1f49b00c56d7a75bae55059e4309ad794a16eb740e9b01f299fe89d7e5bdc52bf3bb76538763ef6c605cc570852759955e5b41928f7bc0236df99016cb5
7
+ data.tar.gz: b73d5e47fcab4ea0cd4cd7c76f4ce8dd8cbdd5a6d004702f897adc81e4a048ce0b713679ab5d1f6ea1b9776f3455f5c5e69e363d4e783c2469358c7dc5aaa959
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/hidg0.rb CHANGED
@@ -294,9 +294,9 @@ class HidG0
294
294
  @dev, @debug = dev, debug
295
295
  end
296
296
 
297
- def keypress(key)
297
+ def keypress(key, duration: 0)
298
298
 
299
- keydown(key); release_keys()
299
+ keydown(key); sleep(duration); release_keys()
300
300
 
301
301
  end
302
302
 
@@ -304,7 +304,7 @@ class HidG0
304
304
 
305
305
  s.gsub(/ /,'{space}').scan(/\{[^\}]+\}|./).each do |x|
306
306
 
307
- if x.length == 1 and x.downcase == x and x[0] != '{' then
307
+ if x.length == 1 and x[0] != '{' then
308
308
 
309
309
  keypress x
310
310
 
@@ -347,10 +347,12 @@ class HidG0
347
347
 
348
348
  write_report(NULL_CHAR*2 + KEYS[key.to_sym].chr + NULL_CHAR*5)
349
349
 
350
- else
350
+ else
351
351
 
352
- write_report(32.chr + NULL_CHAR + KEYS[KEYS[key.to_sym]].chr + \
353
- NULL_CHAR*5)
352
+ # the key can be reproduced by combining tke key press with the shift key
353
+
354
+ write_report(MODIFIERS[:shift].chr + NULL_CHAR + \
355
+ KEYS[KEYS[key.to_sym]].chr + NULL_CHAR*5)
354
356
 
355
357
  end
356
358
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hidg0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file