Re: Fw: Re: [AD] messy allegro 5.0 stuff

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Shawn Hargreaves wrote:

> Why not:
> 
> 	al_read_key(int *unicode, int *scancode);
> 
> Plus provide two helper functions for the common case where you
> only care about a single value:
> 
> 	int al_read_unicode()
> 	int al_read_scancode()

If returning a struct AL_KEY with both scancode and unicode in it is
not acceptable for binary compatibility (which surprised me, but I'll
accept it from you experts :) then the above suggestion looks best to
me. It is probably the cleanest way for the case where you need both
values, and it leaves a simple solution for my common case where I
just need to check 

if (al_read_scancode() == AL_KEY_BLABLA)

I think in this case the benifit of having functions with a single
return value available outweighs the 'ugliness' of 3 functions where
it could theoretically be one.

Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<
 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/