etch/cursor

This module provides cursor associated functions like moving it, hiding it or setting its style.

Types

Cursor style.

pub type CursorStyle {
  DefaultShape
  BlinkingBlock
  SteadyBlock
  BlinkingUnderScore
  SteadyUnderScore
  BlinkingBar
  SteadyBar
}

Constructors

  • DefaultShape

    Default cursor shape.

  • BlinkingBlock

    Blinking block █.

  • SteadyBlock

    Steady (non-blinking) block █.

  • BlinkingUnderScore

    Blinking underscore _.

  • SteadyUnderScore

    Steady (non-blinking) underscore _.

  • BlinkingBar

    Blinking bar |.

  • SteadyBar

    Steady (non-blinking) bar |.

Values

pub fn hide() -> String

Hides cursor. It is prefered not to use this directly. See Hide.

pub fn move_down(n: Int) -> String

Moves cursor n rows to the down. It is prefered not to use this directly. See MoveDown.

pub fn move_left(n: Int) -> String

Moves cursor n column to the left. It is prefered not to use this directly. See MoveLeft.

pub fn move_right(n: Int) -> String

Moves cursor n column to the right. It is prefered not to use this directly. See MoveRight.

pub fn move_to(x: Int, y: Int) -> String

Moves cursor to the given position. It is prefered not to use this directly. See MoveTo.

pub fn move_to_column(n: Int) -> String

Moves cursor to the given column (the row remains unchainged). It is prefered not to use this directly. See MoveToColumn.

pub fn move_to_next_line(n: Int) -> String

Moves cursor to the next line (at the beginning of the line below). It is prefered not to use this directly. See MoveToNextLine.

pub fn move_to_previous_line(n: Int) -> String

Moves cursor to the previous line (at the beginning of the line above). It is prefered not to use this directly. See MoveToPreviousLine.

pub fn move_to_row(n: Int) -> String

Moves cursor to the given row (the column remains unchainged). It is prefered not to use this directly. See MoveToRow.

pub fn move_up(n: Int) -> String

Moves cursor n rows to the up. It is prefered not to use this directly. See MoveUp.

pub fn restore_position() -> String

Restores saved cursor position. It is prefered not to use this directly. See RestorePosition.

pub fn save_position() -> String

Saves current cursor position. It is prefered not to use this directly. See SavePosition.

pub fn set_cursor_style(s: CursorStyle) -> String

Sets cursor style. It is prefered not to use this directly. See SetCursorStyle.

pub fn show() -> String

Shows cursor. It is prefered not to use this directly. See Show.

Search Document