code: func GrabKeyboard(xu *xgbutil.XUtil, win xproto.Window) error {
  	reply, err := xproto.GrabKeyboard(xu.Conn(), false, win, 0,
  		xproto.GrabModeAsync, xproto.GrabModeAsync).Reply()
  	if err != nil {
  		return fmt.Errorf("GrabKeyboard: Error grabbing keyboard on "+
  			"window '%x': %s", win, err)
  	}
  
  	switch reply.Status {
  	case xproto.GrabStatusSuccess:
  		// all is well
  	case xproto.GrabStatusAlreadyGrabbed:
  		return fmt.Errorf("GrabKeyboard: Could not grab keyboard. " +
  			"Status: AlreadyGrabbed.")
  	case xproto.GrabStatusInvalidTime:
  		return fmt.Errorf("GrabKeyboard: Could not grab keyboard. " +
  			"Status: InvalidTime.")
  	case xproto.GrabStatusNotViewable:
  		return fmt.Errorf("GrabKeyboard: Could not grab keyboard. " +
  			"Status: NotViewable.")
  	case xproto.GrabStatusFrozen:
  		return fmt.Errorf("GrabKeyboard: Could not grab keyboard. " +
  			"Status: Frozen.")
  	}
  	return nil
  }
docs: // GrabKeyboard grabs the entire keyboard.
  // Returns whether GrabStatus is successful and an error if one is reported by
  // XGB. It is possible to not get an error and the grab to be unsuccessful.
  // The purpose of 'win' is that after a grab is successful, ALL Key*Events will
  // be sent to that window. Make sure you have a callback attached :-)