Esempio n. 1
0
func Reset() {
	currentLine = []rune{}
	currentScroll = 0
	cursor = 0
	updateCursor()
	display.ShowLine(visibleLine())
	display.DrawLine()
}
Esempio n. 2
0
func CursorLeft() {
	if cursor != 0 {
		cursor--
	}
	if cursor < currentScroll {
		currentScroll--
		display.ShowLine(visibleLine())
	}
	updateCursor()
}
Esempio n. 3
0
func CursorAtEnd() {
	width := display.LineWidth()
	cursor = len(currentLine)
	if len(currentLine) < width {
		currentScroll = 0
	} else {
		currentScroll = len(currentLine) - width
	}
	display.ShowLine(visibleLine())
	updateCursor()
}
Esempio n. 4
0
func CursorRight() {
	width := display.LineWidth()
	if cursor < len(currentLine) {
		cursor++
	}
	if cursor > width+currentScroll {
		// LogS(fmt.Sprintf("-- %d", cursor))
		currentScroll++
		display.ShowLine(visibleLine())
	}
	updateCursor()
}
Esempio n. 5
0
func Draw() {
	display.ShowLine(visibleLine())
	display.SetCursor(cursor - currentScroll)
	display.DrawLine()
	display.Flush()
}
Esempio n. 6
0
func CursorAtBeginning() {
	cursor = 0
	currentScroll = 0
	display.ShowLine(visibleLine())
	updateCursor()
}