Sha256: 88a00619271e209ce9a342e3f244338dfacfe2413bbb0edcbc3a8c0b65559b72

Contents?: true

Size: 458 Bytes

Versions: 9

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

module Fusuma
  module Plugin
    module Sendkey
      # handle Evdev device
      class Device
        def initialize(path:)
          @evdev = Revdev::EventDevice.new(path)
        end

        def path
          raise 'Device path is not found' if @evdev.nil?

          @path ||= @evdev.file.path
        end

        def write_event(event)
          @evdev.write_input_event(event)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fusuma-plugin-sendkey-0.6.4 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.3 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.2 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.1 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.0 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.0.pre2 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.6.0.pre lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.5.1 lib/fusuma/plugin/sendkey/device.rb
fusuma-plugin-sendkey-0.5.0 lib/fusuma/plugin/sendkey/device.rb