Simulating button presses

Hi all,

I’m still trying to solve some issues when passing events consumed inside wxPython frames to showBase. My current solution seems a bit flimsy, so I’m looking for a something more robust. It looks like the answer might be in WxPandaWindow when the call self.inputDevice.buttonDown(key) is made. Am I right it assuming this forces the inputDevice to think a certain button is down? If this is the code I need is it only available in the dev snapshot of Panda? Calling this in my own code gives me:

AttributeError: 'libpanda.GraphicsWindow' object has no attribute 'getInputDevice'

Any help would be appreciated!

This buttonDown() call is meant only for a CallbackGraphicsWindow, which is a special kind of OpenGL graphics window that renders into a context not created by Panda. This kind of window is used by WxPandaWindow to work with wx’s insistence on creating its own OpenGL contexts.

However, if you’re creating your own window in Panda and simply parenting it to the wx frame, instead of using the WxPandaWindow interface, then you can’t send it events this way. In this case, the window is responsible for getting its own events from the operating system.

David