void (@NotNull InputEvent inputEvent, @NotNull AnAction action, @NotNull AnActionEvent event) { Runnable runnable = () -> super.performAction(inputEvent, action, event); event.accept(new AnActionEventVisitor() { @Override public void visitGestureInitEvent(@NotNull AnActionEvent anActionEvent) { if (action instanceof KeyboardGestureAction) { runnable.run(); } } @Override public void visitGesturePerformedEvent(@NotNull AnActionEvent anActionEvent) { runnable.run(); } @Override public void visitGestureFinishEvent(@NotNull AnActionEvent anActionEvent) { if (action instanceof KeyboardGestureAction) { runnable.run(); } } }); }