Sha256: 4b5244d808b5d7558ccec4ab563d17e03ba979730835c189c8250a43df8fb0ac

Contents?: true

Size: 960 Bytes

Versions: 4

Compression:

Stored size: 960 Bytes

Contents

# frozen_string_literal: true

require_relative "text_record"

module Fusuma
  module Plugin
    module Events
      module Records
        # Gesture Record
        class GestureRecord < Record
          # define gesture format
          attr_reader :status, :gesture, :finger, :delta

          Delta = Struct.new(
            :move_x, :move_y,
            :unaccelerated_x, :unaccelerated_y,
            :zoom,
            :rotate
          )

          # @param status [String]
          # @param gesture [String]
          # @param finger [String, Integer]
          # @param delta [Delta, NilClass]
          def initialize(status:, gesture:, finger:, delta:)
            super()
            @status = status
            @gesture = gesture
            @finger = finger.to_i
            @delta = delta
          end

          def to_s
            "#{@gesture}, Finger: #{@finger}, Status: #{@status}"
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fusuma-3.7.0 lib/fusuma/plugin/events/records/gesture_record.rb
fusuma-3.6.2 lib/fusuma/plugin/events/records/gesture_record.rb
fusuma-3.6.1 lib/fusuma/plugin/events/records/gesture_record.rb
fusuma-3.6.0 lib/fusuma/plugin/events/records/gesture_record.rb