class TouchscreenTaps::Runner

Main runner

Public Class Methods

new(config_path) click to toggle source
# File lib/touchscreen_taps.rb, line 16
def initialize(config_path)
  config       = Config.new(config_path)
  @buffer      = config.buffer
  @touchscreen = config.touchscreen
  @detector    = TapAndHoldDetector.new(config)
  @executor    = Executor.new(config)
end

Public Instance Methods

process_events() click to toggle source
# File lib/touchscreen_taps.rb, line 24
def process_events
  Libinput.events(@touchscreen) do |event|
    event = EventFilter.call(event)
    next unless event

    event = EventParser.call(event)
    @buffer.push(event)
    command = @detector.process(@buffer)
    @executor.run(command)
  end
end