def start_watching
      return if @worker
      @worker = Thread.new do
        loop do
          event = read
          next unless ALLOWED_EVENT_TYPES.include?(event.type)
          case event.type
            when BUTTON_TYPE
              RubyHid::Button.trigger_event(event.code, event.value)
            when AXIS_TYPE
              RubyHid::Axis.trigger_event(event.code, event.value)
          end
        end
      end
    end
def start_watching
      return if @worker
      @worker = Thread.new do
        loop do
          event = read
          next unless ALLOWED_EVENT_TYPES.include?(event.type)
          case event.type
            when BUTTON_TYPE
              RubyHid::Button.trigger_event(event.code, event.value)
            when AXIS_TYPE
              RubyHid::Axis.trigger_event(event.code, event.value)
          end
        end
      end
    end
Start a background worker which scans input file
 and triggers any events bound to each one.