Resetting/Dissociating pointer location from mouse movement

Hi Chris,

I’m in the Jazayeri Lab, and I have a quick question for you regarding Mworks: I am currently trying to design a psychophysics experiment where I require participants (among other things) to use the mouse to move a cursor (white dot) along a horizontal line on the display. Once the cursor has reached a target location, the participant has to press a key to validate and the experiment moves on to the next trial. My issue is the following: on the next trial, I would like the cursor to reappear at the center of the display, i.e., not where the physical mouse pointer is (since the participant had just moved the mouse to previous target location). Is there a way to either dissociate mouse movement from the physical location of the hidden pointer, or alternatively, to reset the physical location of the pointer at the center of the display at the beginning of each trial?

I tried to offset the cursor position by the final location of the pointer on the previous trial, but this is not a satisfying solution since the hidden pointer eventually "runs away” from the screen, at which point the cursor cannot cover the whole screen anymore. Do you have any thoughts? Do you think I’d have a better chance to work around this issue by using a USB HID Device instead of a mouse?

Let me know when you get a chance!

PS: I had forgotten to thank you for helping me with an issue I had while trying to connect a client to a server running different version of Mworks. This problem is solved now :slight_smile:

Best,
Nicolas

Hi Nicolas,

Is there a way to either dissociate mouse movement from the physical location of the hidden pointer, or alternatively, to reset the physical location of the pointer at the center of the display at the beginning of each trial?

At present, neither of these options is supported by MWorks. Although we could add support for either of them, I think I’d prefer the second.

Alternatively, we could enhance the mouse input device to expose the change in x/y position from one mouse-movement event to the next. Even when the cursor is “stuck” at a display boundary, the OS still provides position change information, which indicates how far the pointer would have moved if it could. Your MWorks experiment could add those position deltas to your cursor’s starting position to determine its current location. I think this is probably the best option.

Do you think I’d have a better chance to work around this issue by using a USB HID Device instead of a mouse?

That might work, although it probably wouldn’t be easy.

The issue is that the USB HID interface is very low level. While you can get mouse position changes, the values are on an arbitrary (or, at least, unknown to me) scale. You’d have to figure out how to map them to MWorks display coordinates, and the mapping might be different for different mice.

Also, some pointing devices (e.g. trackpads or Bluetooth mice) may not be accessible via USB HID at all.

Chris

Hi Chris,

Thanks for getting back to me. I’d also prefer the second option, i.e, being able to reset the mouse pointer position––this is actually what I used when coding my experiment in Matlab/Psychtoolbox. The alternative you propose (working with mouse movements as opposed to cursor movements which are limited by the display boundaries) could also work for me. Any chance you could add either of these features in one of the next nightly-built versions? I don’t have a good sense of how long your to-do list is (probably long ^^), but I’m planning to run subjects on my task soon, so whenever you get a chance, I’d really appreciate if you can implement that.

Let me know if you think that’s doable in the next few days/weeks. Also, feel free to make our conversation ‘public’ on the website if you think other people might be interested.

Thanks!
Nicolas

Any chance you could add either of these features in one of the next nightly-built versions?

I’m working on it. I’ll try to get something in to the nightly build in the next few days.

Chris

Awesome, thank you so much!

Nicolas

Hi Nicolas,

The current MWorks nightly build has a new action: move_mouse_cursor. Usage is straightforward: You give it a mouse input device and x/y position in degrees, and it moves the cursor to that position.

When you have a chance, please try it out and let me know if it meets your requirements.

Thanks,
Chris

Hi Chris,

I just tested it, it works beautifully; simple and easy to use! thanks for being so quick at implementing this solution.

Have a great day!
Nicolas