|
@@ -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
|