Interference when using two mice

Hello,

I am trying two read the input of two mice from two screen in Ubuntu 20.4 in Matlab 2024a with Psychtoolbox 3.0.19.14.

I am using this to let two participants that each have a mouse and a screen to rate and experiment.
For this I am continuously reading in the inputs of both mice and updating the position of a circle that is drawn on the corresponding screen of each mouse.

This seems to work well if only once person is moving their mouse but once both mice are moved at the same time there is interference. The mouse information is not read correctly anymore and the data of the wrong mouse is used to update the screen of the other participant.

I am aware that for extensive support I would need to use the payed support but I am not looking for a solution for my programming issue, I am just looking for the answer to a simple question. Is this task something that “should” work in psychtoolbox? Should it be possible to read the data information of two mice at the same time and update two screens with that information without the data streams getting mixed up?

I want to make sure this task is even possible before I spent significant time trying to make it work.

Thanks!
Christian

can you send the line with the call for reading the mouse data that you are using?

[cursorX, cursorY, clicks] = GetMouse(giverwindow, m1ID);
[cursorX2, cursorY2, clicks2] = GetMouse(receiverwindow,m2ID);

giverwindow and receiverwindow are the two xscreens of each participants and m1ID and m2ID are the respective mice of each person.

I am later using cursorX and cursorY to update the circle on giverwindow and cursorX2 and cursorY2 to update the circle on receiverwindow.

This works correctly if only one mouse moves. Only the circle of the correct screen corresponding to the mouse updates the other circle corresponding to the mouse that doesnt move remains still which feels like the data is read and used correctly. But when both mice move it seems the movement of both mice is updating the circles on both screens.

It should be possible to do this, as implemented and tested in the past, although I don’t think I have tested it extensively in probably the last 8 years. See MouseTraceDemo3.m the approach taken in that demo is to create additional master pointers, ie. multiple mouse cursors, and attach different mice to drive their own associated master pointers. The xinput command line tool allows such configuration. One can also detach a slave pointer from the master pointer (make it a “floating device”) so its mouse movements don’t drive the master pointer anymore. Or look at the optional valuator vector. There’s also MouseMotionRecordingDemo.m which may be instructive.

So far, for free.

Thank you for you help! That helps a lot! i will get it to work!