Triggering rtl using interrupt on aux pin of pixhawk

Hello,
I am working on one of my own project and wanted to trigger rtl mode using interrupt on aux pins of pixhawk. Interrupt will be from some sensor in the form of pin high.
Is there any way to achieve this.

Thanks

I need the same functionality. If you have figured this out, or have an answer, please let me know.

Have you tried looking into this?

https://ardupilot.org/copter/docs/common-buttons.html