Page 1 of 1

Windows Mouse Movement Overlay

Posted: 09 Oct 2020, 16:56
by reterik
I am just looking to use the windows mouse cursor using BCI2000, please advise.

Re: Windows Mouse Movement Overlay

Posted: 12 Oct 2020, 10:19
by mellinger

I assume you are using a batch file to start BCI2000, not BCI2000Launcher, and that you are using CursorTask as the application module.
In the batch file you use to start up BCI2000, add a line "WATCH CursorPosX 4001", and add a line "WATCH CursorPosY 4002" after all modules have been started.

Then, you can read the value of CursorPosX from local UDP port 4001, and the value of CursorPosY from local UDP port 4002.
In bci2000/src/contrib/AppConnectorApplications/SimpleExample/SimpleExample.cpp, there is a program that demonstrates how to read from a UDP port in C++.
Setting the cursor position in Windows is done using the SetCursorPos API ( ... tcursorpos).
Note that in BCI2000, the two CursorPos values range from 0 to 32768 each, so you will need to translate them to screen size first ( ... resolution).

Let me know if you have further questions,