def grab_button(self, button: Mouse) -> None:
        """Grab the given mouse button event"""
        try:
            button.modmask = self.core.grab_button(button)
        except utils.QtileError:
            logger.warning("Unknown modifier(s): %s", button.modifiers)
            return
        self._mouse_map[button.button_code].append(button)
Grab the given mouse button event
libqtile/core/manager.py