code: func (t *tScreen) parseXtermMouse(buf *bytes.Buffer) (bool, bool) {
  
  	b := buf.Bytes()
  
  	state := 0
  	btn := 0
  	x := 0
  	y := 0
  
  	for i := range b {
  		switch state {
  		case 0:
  			switch b[i] {
  			case '\x1b':
  				state = 1
  			case '\x9b':
  				state = 2
  			default:
  				return false, false
  			}
  		case 1:
  			if b[i] != '[' {
  				return false, false
  			}
  			state = 2
  		case 2:
  			if b[i] != 'M' {
  				return false, false
  			}
  			state++
  		case 3:
  			btn = int(b[i])
  			state++
  		case 4:
  			x = int(b[i]) - 32 - 1
  			state++
  		case 5:
  			y = int(b[i]) - 32 - 1
  			for i >= 0 {
  				buf.ReadByte()
  				i--
  			}
  			t.postMouseEvent(x, y, btn)
  			return true, true
  		}
  	}
  	return true, false
  }
docs: // parseXtermMouse is like parseSgrMouse, but it parses a legacy
  // X11 mouse record.