xinput_wrapper 0.1.2 → 0.1.3
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/xinput_wrapper.rb +9 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: d2487ccda5f3bb7af5fa098b2e521edf98c7d1e4
         | 
| 4 | 
            +
              data.tar.gz: d8c547a5da867932cc4cf8611bb2efb0e1d59dbe
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 37f5a0d2175879a3797bfc7b4bccf4070982b08cb01c99d73da62ea1b7ca1ee93a597ff1a43fe5a463d09110a0db6b210a36903030f0cda9ad3f54f07052b711
         | 
| 7 | 
            +
              data.tar.gz: 9a3efa111712126a516d19220d31254e259536079ecf474ffea5a160161de59c2cc616de83eb376f5345d4055712c6f3359b42ab65fa391cb47a0e931042e187
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/lib/xinput_wrapper.rb
    CHANGED
    
    | @@ -10,7 +10,8 @@ require 'secret_knock' | |
| 10 10 | 
             
            class XInputWrapper
         | 
| 11 11 |  | 
| 12 12 | 
             
              def initialize(device: '3', host: 'sps', port: '59000', 
         | 
| 13 | 
            -
             | 
| 13 | 
            +
                             topic: 'input/keyboard', verbose: true, lookup: {}, 
         | 
| 14 | 
            +
                             interval: nil, debug: false)
         | 
| 14 15 |  | 
| 15 16 | 
             
                @lookup = {
         | 
| 16 17 | 
             
                  37 => :control,
         | 
| @@ -18,10 +19,10 @@ class XInputWrapper | |
| 18 19 | 
             
                  133 => :super
         | 
| 19 20 | 
             
                }.merge(lookup)
         | 
| 20 21 |  | 
| 21 | 
            -
                @device, @topic, @verbose = device, topic, verbose
         | 
| 22 | 
            +
                @device, @topic, @verbose, @debug = device, topic, verbose, debug
         | 
| 22 23 | 
             
                @sps = SPSPub.new host: host, port: port
         | 
| 23 24 | 
             
                @sk = SecretKnock.new short_delay: 0.25, long_delay: 0.5, 
         | 
| 24 | 
            -
                                          external: self, verbose: verbose
         | 
| 25 | 
            +
                                          external: self, verbose: verbose, debug: debug
         | 
| 25 26 | 
             
                @interval = interval
         | 
| 26 27 | 
             
                @time = Time.now if interval
         | 
| 27 28 |  | 
| @@ -58,8 +59,10 @@ class XInputWrapper | |
| 58 59 | 
             
                  if type == 13 then
         | 
| 59 60 |  | 
| 60 61 | 
             
                    keycode = x[/detail: (\d+)/,1].to_i
         | 
| 62 | 
            +
                    next if keycode == 0
         | 
| 61 63 |  | 
| 62 64 | 
             
                    puts 'keycode: ' + keycode.to_s if keycode > 0 and @verbose
         | 
| 65 | 
            +
                    puts '>keycode: ' + keycode.to_s  if @debug
         | 
| 63 66 |  | 
| 64 67 | 
             
                    if @interval then
         | 
| 65 68 |  | 
| @@ -79,8 +82,10 @@ class XInputWrapper | |
| 79 82 | 
             
                      puts 'super key pressed'  if @verbose
         | 
| 80 83 | 
             
                      message 'super key pressed' 
         | 
| 81 84 | 
             
                    end
         | 
| 85 | 
            +
                    
         | 
| 86 | 
            +
                    sk.reset if @lookup[keycode] != :control
         | 
| 82 87 |  | 
| 83 88 | 
             
                  end
         | 
| 84 89 | 
             
                end
         | 
| 85 90 | 
             
              end
         | 
| 86 | 
            -
            end
         | 
| 91 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: xinput_wrapper
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - James Robertson
         | 
| @@ -31,7 +31,7 @@ cert_chain: | |
| 31 31 | 
             
              0ymew047+vZ5lDTOdEUMd+CsRmgoJBLRWXaTiHO05e7v3xtW9wDxP01a+FGQiYcj
         | 
| 32 32 | 
             
              5bdH23akkNF4CA==
         | 
| 33 33 | 
             
              -----END CERTIFICATE-----
         | 
| 34 | 
            -
            date:  | 
| 34 | 
            +
            date: 2018-08-05 00:00:00.000000000 Z
         | 
| 35 35 | 
             
            dependencies:
         | 
| 36 36 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 37 | 
             
              name: sps-pub
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |