private static @NotNull Keymap getRootKeymap(@NotNull Keymap keymap) {
    while (keymap.canModify()) {
      Keymap parent = keymap.getParent();
      if (parent == null) {
        break;
      }
      else {
        keymap = parent;
      }
    }
    return keymap;
  }
private static @NotNull Keymap getRootKeymap(@NotNull Keymap keymap)