Cabbage Logo
Back to Cabbage Site

Capturing mouse gestures

Hello, I’ve created a simple method of capturing mouse gestures that also captures the number of k-cycles between each mouse movement. I admit that I’ve not done extensive testing, but something really has me baffled. The k-cycle counts that I have been getting range from 16 up to whatever times you hold the mouse still with the left mouse down.

So, this starts capturing the mouse location when the left button is pressed, and as long as the button is held, the mouse movements are captured along with the elapsed k-cycle count.

My issue is that when I try to drag the mouse with the button down in an even steady pace, I’m getting times ranging from 16 and up to 144. So if those are k-cycles being counted, that would ranging from 0.011616 seconds upto 0.104544. I get why the lower value of 16 is the lowest it will go (Cabbage gui is quantized to a time grid), but I don’t understand why I am getting values as much as ten time (or more) greater than the lowest value when I am dragging the mouse relatively steady and consistent.

GridPads.csd (11.7 KB)

The first column has the delta times for the mouse locations, and as far as I can tell I moved the mouse in a fairly steady pace. So, why are the times so widely different?

So this looks like a very complex way to capture mouse gestures? Would something like this not be easier? MouseGestures.csd (1.3 KB)

If you print the value of kIndex here are releasing the mouse it seems to show the correct number of k-cycles too.

I’ll need to check this out, but in reading the code, it appears The mouse XY pairs will get stored on every k-cycle. While I’m only recording them when their values change, this allows for the user to keep the mouse stationary and it just keeping counting the k-cycles until the next mouse movement or the button is released.

I’ll check this out when I get home. Probably won’t be hard to modify what you have.

OK, this is only that much more amazing, if only I’ve got no freaking clue how you are storing the time values. And you made me think again, mostly because your program is the flip side of what I was trying to do, but I can also deduce what I need from this.


It is mesmerizing to watch…

I know, a whole evenings worth of entertainment :rofl:

1 Like