Flexibly disabling/enabling keys

Hi All,
Apologies if this has been asked - I had trouble finding information on this.

I’m using Panda3D (via PandaEPL - memory.psych.upenn.edu/PandaEPL) to run a navigation experiment for psychology research. By default, PandaEPL has us logging a number of keys, including the arrow/direction keys for navigation. The problem is, it is very problematic to have Panda’s VR environment always listening to those keypresses - during down-times in the script we don’t want it updating coordinates of the navigator if they press those buttons for some reason!

Is there a straightforward way to disable and re-enable these keys at different parts of our python code?

Thanks so much for your guidance!