Keep moving mouse cursor while pointing somewhere RRS feed

  • Question

  • So, i'm trying to create a Kinect application where the mouse is controlled by the movements of the head.

    if (faceFrame.TrackSuccessful)
                var pontosFace = faceFrame.GetProjected3DShape();
                int topofscreen = Convert.ToInt32(pontosFace[41].Y);
                int leftofscreen = Convert.ToInt32(pontosFace[41].X);
                SetCursorPos(leftofscreen, topofscreen);
                txty.Text = Convert.ToString(topofscreen);
                txtx.Text = Convert.ToString(leftofscreen);

    I've managed to control it, according to exact position of a given point in the face tracked by the Kinect, but this limits the movement of the mouse into a really small area if the person is seated. This only works if the persons keeps moving his head all around a room.

    My question is: Is there a way to set the position of the mouse cursor dynamically? In other words, i don't want to set it to my exact position. I want to set it to where the tracked point is pointing. For example, if i move my head to the upper-left and stop, the mouse should keep moving in that direction.

    Or is there a way to increase the tracked point range to larger area?

    • Edited by PedroBoga Monday, November 26, 2012 11:25 AM
    Monday, November 26, 2012 11:24 AM

All replies


    I suggest you first take a fix position for the tracked point then move mouse pointer relative to the fix position. For example if you move your head upper-left then add a value to leftofscreen and topofscreen relative to the fix position.

    It should be like mode 2 of moving mouse by this software

    I don't take a fix position, I use the center of the area defined by user. Unfortunately you can't select head to move mouse pointer by the software.

    Good luck.

    Monday, November 26, 2012 5:29 PM