Help Capturing KeyDown in Modal

Hello Developers!

I’m working on a plugin to mimic the Helm-style interface from Spacemacs/Doom, and I’m running into a surprising challenge of figuring out how to capture the key presses while the modal is displayed.

What’s the proper way to do this? The Obsidian provided registerEvent doesn’t have a keydown capture, so I suppose I just add an EventListener to the whole document?

All guidance would be much appreciated.