class Rcursor

Public Class Methods

goto(x=0, y=0) click to toggle source
# File lib/rubterm_string.rb, line 483
def self.goto(x=0, y=0)

  print "\u001b[#{y};#{x}H"
  return {:x=>x, :y=>y}

end
move(dir, pos=1) click to toggle source
# File lib/rubterm_string.rb, line 490
def self.move(dir, pos=1)

  case dir

  when :n, :up
    print "\u001b[#{pos}A"
    return dir

  when :s, :down
    print "\u001b[#{pos}B"
    return dir

  when :e, :right
    print "\u001b[#{pos}C"
    return dir

  when :w, :left
    print "\u001b[#{pos}D"
    return dir

  else
    return false 

  end

end
position(mode=:load) click to toggle source
# File lib/rubterm_string.rb, line 464
def self.position(mode=:load)

  case mode

  when :load
    print "\u001b[u"
    return mode

  when :save
    print "\u001b[s"
    return mode

  else
    return false

  end
  
end