[Bf-python] Space handler script links
Willian Padovani Germano
wgermano at ig.com.br
Tue May 10 04:17:12 CEST 2005
Campbell Barton wrote:
> Willian, this is the part thats not working. Blender.event is None, Im
> not trying to set it, Im juts trying to print Blender.event whenever a
> key is hit. and its printing a blank line.
Hi, does Blender.bylink print 1 and Blender.link print 1?
(Blender.link = 1 for space handlers is related to the new constant dict
key Blender.SpaceHandlers.VIEW3D_EVENT)
And is the key ignored in the window or is it processed? Like: does 'a'
select or deselect objects, TAB enters editmode, etc.? And what about
the example I posted yesterday? ->
# -----
# SPACEHANDLER.VIEW3D.EVENT
import Blender
from Blender import Draw
evt = Blender.event
if evt >= Draw.AKEY and evt <= Draw.ZKEY:
Draw.PupMenu("%s", % chr(evt))
elif evt in [Draw.LEFTMOUSE, Draw.MIDDLEMOUSE, Draw.RIGHTMOUSE]:
Draw.Pupmenu("Mouse button %d pressed" % evt)
else: evt = None # tell that we want to return the event
# set Blender.event to None so grabbed event won't be
# further processed by Blender:
if evt: Blender.event = None
# -----
does it work?
Usual question: which OS?
PS: I should be on #blendercoders an hour from now +-, for a while.
--
Willian
More information about the Bf-python
mailing list