Sketch for having an equivalent to MouseX in the language, on guis etc.
First code examples:// use just the Mouse class (no polling needed): Mouse.pos Mouse.x Mouse.y // start polling - more efficient with multiple instances Mouse.start; // use instances with independent actions: // args are mouse, xval, yval, xraw, yraw Mouse(\a, { |...args| args.postln }); // post just x Mouse(\a, { |mouse, x| x.round(0.0001).postln }); // try to post x and y - but forgot y -> error // -> posts "Mouse(\a).action failed." Mouse(\a, { |mouse, x| [x, y].round(0.0001).postln }); // see the error Mouse(\a).doAction; // fix it Mouse(\a, { |mouse, x, y| [x, y].round(0.0001).postln }); // second mouse instance, use spec for x Mouse(\b, { |mouse, x| x.round(0.01).postln }, [20, 2000, \exp]); Mouse(\a).free; // b remains Mouse(\b).free; Mouse.free; */