code: def __ungrabAllHotkeys(self):
          
          c = self.app.configManager
          hotkeys = c.hotKeys + c.hotKeyFolders
  
          # Ungrab global hotkeys in root window, recursively
          for item in c.globalHotkeys:
              if item.enabled:
                  self.__ungrabHotkey(item.hotKey, item.modifiers, self.rootWindow)
                  if self.__needsMutterWorkaround(item):
                      self.__ungrabRecurse(item, self.rootWindow, False)
          
          # Ungrab hotkeys without a filter in root window, recursively
          for item in hotkeys:
              if item.get_applicable_regex() is None:
                  self.__ungrabHotkey(item.hotKey, item.modifiers, self.rootWindow)
                  if self.__needsMutterWorkaround(item):
                      self.__ungrabRecurse(item, self.rootWindow, False)
                  
          self.__recurseTreeUngrab(self.rootWindow, hotkeys)
docs: Ungrab all hotkeys in preparation for keymap change