DirectEntry and Accept

It’s definitely possible.
Basically, you can use suppressKeys=1 for your DE’s init setting, to block keypresses from triggering any event.
But unfortunately, DE suppresses keys not only when it’s in focus, but also when the mouse rolls over it (while it’s not in focus).

A clean way to work around this is creating a wrapper class of DE, which does these :

  1. focusInCommand : run a function to alter the default button thrower’s current prefix
  2. focusOutCommand : run a function to restore button thrower’s previous prefix

Button thrower prefix is added as events’ prefix, e.g. :
prefix : ‘’ (nothing), event : ‘myEvent’
prefix : ‘DE in focus-’, event : ‘DE in focus-myEvent’

The default button thrower object is :
base.buttonThrowers[0].node()

I use it heavily in here (I use 3 wrapped DGUI classes) :
discourse.panda3d.org/viewtopic.php?t=2642