Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Quote - I can't see anything to suggest that you can't Bind key events to a panel, but the problem I supsect you'll run into is one of the Panel having focus (aspects of the Poser GUI may exacerbate this) or making sure controls within the panel pass unhandled key events up the chain.
Yes, you're right, I shouldn't have tested that late at night, it works, if the panel is selected. Thanks :-)
I also found a way to stop Poser reacting to the pressed key:
Bind components of Panel to EVT_KEY_DOWN
and have the event handler do event.SetUnicodeKey(0)... I'm not sure if that's safe to do, but it works at the moment ;-) (maybe it stops when I try that again tomorrow ;-))
Probably better to use event.StopPropagation()
I've got still no idea, why Unbind gives
Traceback (most recent call last):<br></br>File "P:Poser 8RuntimePythonposerScriptsScriptsMenumousewheelposing.py", line 79, in EvtKey
self.Unbind(wx.EVT_KEY_DOWN, self.EvtKey)
File "P:Poser 8RuntimePythonlibsite-packageswx-2.8-msw-ansiwx_core.py", line 3916, in Unbind
id = source.GetId()
AttributeError: 'function' object has no attribute 'GetId'
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Did anyone manage to bind keyboard events to a wxPanel?
Is unbinding events possible? I'm getting a Python error when doing an Unbind, but I have no idea if that's a broken Python lib or me ;-)