def grab_keys(self) -> None:
        """Re-grab all of the keys configured in the key map

        Useful when a keyboard mapping event is received.
        """
        self.core.ungrab_keys()
        keys = self.keys_map.copy()
        self.keys_map.clear()
        for key in keys.values():
            self.grab_key(key)
Re-grab all of the keys configured in the key map

        Useful when a keyboard mapping event is received.
        
libqtile/core/manager.py