Ver código fonte

Use default Inactivity value.

Steve Thielemann 3 anos atrás
pai
commit
d31ec0ef2a
3 arquivos alterados com 3 adições e 2 exclusões
  1. 1 0
      door/door.go
  2. 1 1
      door/input.go
  3. 1 1
      testdoor/testdoor.go

+ 1 - 0
door/door.go

@@ -19,6 +19,7 @@ var CP437 bool              // CP437 support detected
 var Full_CP437 bool         // Full CP437 support detected (handles control codes properly)
 var Height int              // Screen height detected
 var Width int               // Screen width detected
+var Inactivity int64 = 120  // Inactivity timeout
 
 /*
 door32.sys:

+ 1 - 1
door/input.go

@@ -341,7 +341,7 @@ func (d *Door) Input(max int) string {
 	var c int
 
 	for true {
-		c = d.WaitKey(120, 0)
+		c = d.WaitKey(Inactivity, 0)
 		if c < 0 {
 			// timeout/hangup
 			return ""

+ 1 - 1
testdoor/testdoor.go

@@ -14,7 +14,7 @@ func main() {
 	bold := door.Color(1, 37, 40)
 	bolder := door.ColorText("BLI BOLD YEL ON BLUE")
 	d.Write("Welcome to " + bolder + "door32.sys" + reset + door.CRNL + "..." + door.CRNL)
-	key := d.WaitKey(120, 0)
+	key := d.WaitKey(door.Inactivity, 0)
 	message := fmt.Sprintf("Key %s%d / %x%s"+door.CRNL, bold, key, key, reset)
 	d.Write(message)
 	b := door.Box{20, 1}