Use ESC Key to reverse a timeline

Needing some help. I am fairly new to using Bricksforge and javascript in general. I currently have a full screen overlay menu that I am triggering via Bricksforge that runs an animation timeline to display the menu. Once the menu is fullscreen I have a button within the menu structure that allows me to reverse the animation to close the menu.

What I am stuck on is figuring out a way to allow the ESC key to also do the same. Does anyone know how to achieve this?