Procházet zdrojové kódy

Updated comments on WantGetMouse.

Steve Thielemann před 1 rokem
rodič
revize
66e3d1c37b
1 změnil soubory, kde provedl 2 přidání a 8 odebrání
  1. 2 8
      door/input.go

+ 2 - 8
door/input.go

@@ -459,16 +459,9 @@ func process(d *Door, newRune bool) {
 }
 
 func (d *Door) WaitKey(timeout time.Duration) (rune, Extended, error) {
-	/*
-		d.readerMutex.Lock()
-		if d.ReaderClosed {
-			d.readerMutex.Unlock()
-			return 0, NOP, ErrDisconnected
-		}
-		d.readerMutex.Unlock()
-	*/
 
 	if WantGetMouse {
+		// Call GetMouse().
 		d.GetMouse()
 	}
 	// Probably faster to just read from closed channel and get ok = false.
@@ -481,6 +474,7 @@ func (d *Door) WaitKey(timeout time.Duration) (rune, Extended, error) {
 			}
 			// return bio.GetKey()
 			if r.Ex == MOUSE {
+				// We want GetMouse() called.
 				WantGetMouse = true
 			}
 			return r.R, r.Ex, r.Err