On Tue, 2004-04-06 at 10:46, Dan Sugalski wrote:

> At 7:42 PM +0200 4/6/04, Jens Rieks wrote:

> >What do you think about a hash interface for event handling?
> >
> >     newsub key, .Sub, _key_x
> >     app["SDLK_x"] = key
> 
> I think... I think I need to get cracking on the event handling spec. 
> I'd prefer SDL to use parrot's built-in event handling system, but 
> for that to happen we first have to *have* a built-in event handling 
> system...

That sounds good to me.  I've not tried to integrate polling or
timer-based events yet.

I used the hash interface in the first version.  It seems simple to
start, but it exposes a lot of complexity to the user unnecessarily. 
SDL Parrot users shouldn't have to know that key up and key down events
have subtypes, for example.

Registering event handlers by subclassing a null object seems a lot
cleaner.  There could be better names for the handler methods though.

-- c

Reply via email to