[Bf-python] Space handler script links
Willian Padovani Germano
wgermano at ig.com.br
Mon May 9 09:47:46 CEST 2005
Campbell Barton wrote:
> Hi Willian, I coundent get the event variable Blender.event to return
> a character, in an event handeling function too of course.
> - Cam
Hi Campbell,
I tested again with fresh cvs a couple minutes ago and all works fine
here. Joilnen (pidhash) had also tested while we chatted on irc hours
ago, both on linux but that shouldn't matter in this case.
Make sure your script appears inside the 3d View -> View -> Space
Handler Scripts menu *and* that it is checked -- you must click on the
Text's name there to activate it. Now the script should be receiving
events from *that* 3d View.
If you mean you can't pass the event back to Blender, simply don't set
Blender.event to None for some event and it will be returned to the 3d
View event callback (winqreadview3dspace in space.c) for it to go on
processing it.
But if you mean you can't change the returned event and have Blender
process it, that isn't allowed (trivial to implement, though) -- mainly
because when hotkeys in Blender become configurable, such scripts would
not work anymore.
BTW, not related to space handlers: your Python console script can
access Blender.event in your gui's event() callback (registered with
Draw.Register) to get the ascii value, this was in the commit, too.
--
Willian
More information about the Bf-python
mailing list