On Wed, Mar 20, 2013 at 04:39:09PM +0400, Ivan Youroff wrote: > Hello there! > I checked documentation and reference, and haven't found any natural way > to implement mouse event handler. Fluxus manual suggests to handle it in > every-frame loop using states of (mouse-button). I thinks it's possible to > get the switch moment keeping the state from prevous frame, but it will > definitely skip short touches (with apple's trackpad for example). > Is there any simple way to write the callback for exact events like > button-down/button-up?
This sounds a bit similar to the problem I had with MIDI; quantising all analysis of the clock to the frame-rate would give considerable jitter when trying to figure out the BPM. I went into the C++ code dealing with incoming MIDI and time-stamped the events there. I imagine something like that will be needed here, it depends a bit on what you need. I can see how if this would happen; -frame tick -button down -button up -frame tick ....you'd miss the button event. A "button-down-since-last-frame" would cure that. The keyboard interface has it, maybe the mouse lacks it. I wonder whether that would be enough. It sounds a bit like what you want would be more like linking buttons to functions that would -at a event- be called with -say- the current mouse cursor location as a parameter. That would be more powerful but considerably harder, I don't think we have anything like that right now. Without something like that I don't see how we'll keep awareness of the mouse cursor's location at the moment of a button-down event; clearly that is likely important information. Interesting issue. Yours, Kas.
