OK, then it will be a callback. The most generalized callback may be something like: int (*)(CSOUND *, void *datap, int type) where 'datap' is a pointer to some kind of data (depending on the 'type' parameter), and the return value depends on whether the operation was successful, failed, or the type is unknown and thus nothing was done. In fact, this approach allows for the same callback to be used for many purposes, although at the cost of some overhead. Also, if the callback can really be used for anything, what should the name be ? On Monday 12 June 2006 20:02, matt ingalls wrote: > the callback does seem like the best way to do it > -- definitely will make it easier to handle the buffering of data. > > would it be overkill if the callback is made even more open-ended? > maybe something like: > > inputDeviceCallback(CSOUND *, int *dataType, float *value, int > *modifiers); > > 'dataType' - code for value returned, keyDown, keyUp, mouseDown, > mouseUp, etc.. > 'value' - depends on dataType. ascii value for keys, (? -- left/ > middle/right mousebutton) , etc.. > 'modifiers' - any modifier keys pressed: option/cntrl/etc (or left/ > middle/right mousebutton?) > > you also have x/y location for mouse clikcs, plus movement (location > or delta) -- > not to mention angle/distance/etc for graphics tablets, which might > want to > be considered here too?? maybe 'value' should then be a pointer to a > struct instead, > which could include 'modifiers', and all relevant value data... > > hmm... maybe we could just enhance the XYINDAT struct and use the > xyin callbacks that are already there? > > but then how to get all that information out as an opcode(s)? _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net