Windows Mouse Movement Overlay

This forum deals with BCI2000 configuration issues.
Post Reply
reterik
Posts: 1
Joined: 09 Oct 2020, 16:55

Windows Mouse Movement Overlay

Post by reterik » 09 Oct 2020, 16:56

I am just looking to use the windows mouse cursor using BCI2000, please advise.

mellinger
Posts: 1208
Joined: 12 Feb 2003, 11:06

Re: Windows Mouse Movement Overlay

Post by mellinger » 12 Oct 2020, 10:19

Hi,

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 (https://docs.microsoft.com/en-us/window ... 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 (https://stackoverflow.com/questions/463 ... resolution).

Let me know if you have further questions,
Jürgen

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests