Get a mouseX values in post window

I would like to get some mouse X value in the post window,

Is there any method to get and check the values on post window?

(
Routine.run {
    inf.do {
        var mouseX = MouseX.kr(1, 10);
        var mouseY = MouseY.kr(1, 10);

        // Print the mouse coordinates to the post window
        [mouseX.value, mouseY.value].postln;

        // Adjust the duration based on your desired update rate
        0.1.wait;
    }
}
)

Will you be satisfied with the following way?

(
s.waitForBoot {
	{
		var mouseX, mouseY;
		mouseX = MouseX.kr(1, 10).poll(10, \x);
		mouseY = MouseY.kr(1, 10).poll(10, "\t\t\ty");
	}.play
}
)
1 Like