modulepackage
0.0.0-20200530105819-84c35e3821e3
Repository: https://github.com/ackneal/scrn.git
Documentation: pkg.go.dev
# README
scrn
This repository contains keyPress handler and simple terminal screen control.
Installation
Install and update this go package with go get -u github.com/ackneal/scrn
Example
package main
import (
"time"
"github.com/ackneal/scrn"
)
func main() {
var s scrn.Screen
s.Open() // open alternate screen
defer s.Close() // close
go func() {
for {
s.Move(1, 1) // moves the position of a cursor
s.Printf("Current Time: %s", time.Now().Format(time.RFC1123Z))
time.Sleep(time.Second)
}
}()
// listens keyPress for q and ESC
quitKey := []scrn.KeyCode{
scrn.KeyCode(int('q')),
scrn.KeyESC,
}
for {
select {
case <-scrn.KeyPress(quitKey...):
return
}
}
}
# Packages
No description provided by the author
# Constants
No description provided by the author
# Variables
No description provided by the author
# Type aliases
No description provided by the author