private static @Nullable KeyboardShortcut findKeyboardShortcut(@NotNull Keymap keymap, @NotNull KeyStroke ks, @NotNull String actionId) {
    Shortcut[] actionShortcuts = keymap.getShortcuts(actionId);

    for (Shortcut sc: actionShortcuts) {
      if (!(sc instanceof KeyboardShortcut ksc))
        continue;
      if (ks.equals(ksc.getFirstKeyStroke()) || ks.equals(ksc.getSecondKeyStroke())) {
        return ksc;
      }
    }
    return null;
  }
private static @Nullable KeyboardShortcut findKeyboardShortcut(@NotNull Keymap keymap, @NotNull KeyStroke ks, @NotNull String actionId)