Sha256: acaadeae3354cab74e40ab7fad2829b9b572731267797b10bd89360eb2b5683d

Contents?: true

Size: 858 Bytes

Versions: 7

Compression:

Stored size: 858 Bytes

Contents

module Vedeu
  module Cursor
    extend self

    def show
      [Esc.esc, '?25h'].join
    end

    def hide
      [Esc.esc, '?25l'].join
    end

    def home
      [Esc.esc, 'H'].join
    end

    def up(count = 1)
      [Esc.esc, "#{count || 1}", 'A'].join
    end

    def down(count = 1)
      [Esc.esc, "#{count || 1}", 'B'].join
    end

    def right(count = 1)
      [Esc.esc, "#{count || 1}", 'C'].join
    end
    alias_method :forward, :right

    def left(count = 1)
      [Esc.esc, "#{count || 1}", 'D'].join
    end
    alias_method :backward, :left

    def save
      [Esc.esc, 's'].join
    end

    def unsave
      [Esc.esc, 'u'].join
    end
    alias_method :restore, :unsave

    def save_all
      [Esc.esc, '7'].join
    end

    def unsave_all
      [Esc.esc, '8'].join
    end
    alias_method :restore_all, :unsave_all
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vedeu-0.0.24 lib/vedeu/output/cursor.rb
vedeu-0.0.23 lib/vedeu/output/cursor.rb
vedeu-0.0.22 lib/vedeu/output/cursor.rb
vedeu-0.0.21 lib/vedeu/output/cursor.rb
vedeu-0.0.20 lib/vedeu/output/cursor.rb
vedeu-0.0.19 lib/vedeu/output/cursor.rb
vedeu-0.0.18 lib/vedeu/output/cursor.rb