예제 #1
0
파일: ncurses.go 프로젝트: Olreich/ncurses
/* Enables half-delay mode. This is the same as cbreak mode (see func CBreak), except that there is a time-out delay on the input, and if no input is received, the input will return an Error and move on. Tenths is the delay in tenths of seconds before the program moves on. It must be between 1 and 255. */
func HalfDelay(tenths int) {
	if tenths > 255 {
		tenths = 255
	} else if tenths < 1 {
		tenths = 1
	}
	C.halfdelay(C.int(tenths))
}
예제 #2
0
// Behaves like cbreak() but also adds a timeout for input. If timeout is
// exceeded after a call to Getch() has been made then GetChar will return
// with an error.
func HalfDelay(delay int) error {
	var cerr C.int
	if delay > 0 {
		cerr = C.halfdelay(C.int(delay))
	}
	if cerr == C.ERR {
		return errors.New("Unable to set delay mode")
	}
	return nil
}
예제 #3
0
파일: curses.go 프로젝트: zozor/gocurse
func Halfdelay(delay int) error {
	if C.halfdelay(C.int(delay)) == ERR {
		return Error //Forkert ERROR
	}
	return nil
}