指向某处时继续移动鼠标光标 [英] Keep moving mouse cursor while pointing somewhere

查看:68
本文介绍了指向某处时继续移动鼠标光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


所以,我正在尝试创建一个Kinect应用程序,鼠标由头部的移动控制。

 if(faceFrame.TrackSuccessful)
{
var pontosFace = faceFrame.GetProjected3DShape();


//作品
int topofscreen = Convert.ToInt32(pontosFace [41] .Y);
int leftofscreen = Convert.ToInt32(pontosFace [41] .X);

SetCursorPos(leftofscreen,topofscreen);

Thread.Sleep(1);

txty.Text = Convert.ToString(topofscreen);
txtx.Text = Convert.ToString(leftofscreen);
}







我已经设法控制它,根据Kinect追踪的一个特定点的确切位置,但这限制了运动如果这个人坐着的话,将鼠标放入一个非常小的区域。这只适用于人们在房间周围移动头部所有
的情况。



我的问题是:有没有办法确定鼠标光标动态?换句话说,我不想把它设置到我的确切位置。我想将它设置为跟踪点指向的位置。例如,如果我将我的头移到左上方并停止,
鼠标应继续向该方向移动。



或者有一种将跟踪点范围增加到更大区域的方法?




解决方案

< BLOCKQUOTE>&NBSP;

我建议你首先为跟踪点取一个固定位置,然后相对于固定位置移动鼠标指针。例如,如果你向左上方移动你的头,那么在相对于修复位置的位置添加一个值到leftofscreen 和topofscreen。


它应该像移动鼠标的模式2一样软件


http://ktoi.site90.com/


我没有采取固定位置,我使用用户定义的区域的中心。不幸的是你不能通过软件选择头移动鼠标指针。


祝你好运。


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();


            //Works
            int topofscreen = Convert.ToInt32(pontosFace[41].Y);
            int leftofscreen = Convert.ToInt32(pontosFace[41].X);

            SetCursorPos(leftofscreen, topofscreen);

            Thread.Sleep(1);

            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?


解决方案

 

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

http://ktoi.site90.com/

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.




这篇关于指向某处时继续移动鼠标光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆