alchemyst/main.go
2018-07-30 18:03:14 +03:00

33 lines
649 B
Go

package main
import "log"
import (
blt "bearlibterminal"
"ui"
"util"
)
func main() {
log.Println("Starting...")
blt.Open()
defer blt.Close()
blt.Print(1, 1, "Hello, world!")
blt.Refresh()
var exit = false
for !exit {
var key, keycode = ui.ReadKey();
if (key != "") {
blt.Print( 1, 3, "Key: ")
}
blt.Print( 1, 3, "Key: " + key )
exit, _ = util.InArray(keycode, []int{blt.TK_CLOSE, blt.TK_ESCAPE})
if (!exit) {
exit = (key == "Ctrl+q")
}
blt.Refresh()
}
log.Println("Closing...")
}