[Bf-python] Event handler (support key up/down)

Martin Poirier theeth at yahoo.com
Mon Mar 10 16:49:56 CET 2008


Hi,

--- Campbell Barton <ideasman42 at gmail.com> wrote:

> Hi, for crystalspace integration, caedes would like
> to be able to get
> all events from an event handler - KeyUp and
> KeyDown,
> This isn't that hard to add, however it means all
> existing event
> handler scripts will also work this way.
> 
> In the attached patch there is Blender.value so you
> can check this for
> key up/down.
> 
> Options are
> - Possibly break existing scripts. (or at least run
> them twice for
> each keypress)
> - Do some trick with negative events (currently
> events are an unsigned
> short), I dont like this at all, but it would at
> least not break any
> existing scripts. very easy to implement.
> - Add an argument for the event handler (wont break
> old scripts)  #
> SPACEHANDLER.VIEW3D.EVENT -all
>   Then we'd need to store the setting for each event
> handler.
> - Add this in a branch (since apricot development
> may need to go in a
> branch anyway)

The branch solution should be the preferred one for
now. Breaking things this close to 2.46 is definitely
NOT an option and there's very little time left for
proper testing. A proper solution for backward compat
can be devised and tested in the branch in the mean
time.

Negative events is a big no no too. There needs to be
a good distinct way to separate up and down events,
but this sort of duct tape solution is not one of
them.

Martin


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the Bf-python mailing list