[英]Set the mouse cursor position in a “Metro” windows 8 program
I am trying to set the position of the mouse cursor (so I can lock it in the center of the screen for the fps I am making) and can not figure out a way to do this. 我正在尝试设置鼠标光标的位置(因此我可以将其锁定在屏幕中央以获得正在制作的fps),但无法找出执行此操作的方法。
I need to set the cursor in the middle of the screen each frame so I can make the games camera handle correctly (typical FPS camera) and without a mouse.setposition equivalent this cannot be done to my knowledge. 我需要将光标设置在每帧屏幕的中间,这样才能使游戏摄像机正确处理(典型的FPS摄像机),并且没有mouse.setposition等效项,这是我所知。
I am writing my program in c#, for the windows 8 store. 我正在用C#为Windows 8存储编写程序。
I have already tried: 我已经尝试过:
[DllImport("user32.dll")]
static extern bool SetCursorPos(int X, int Y);
我刚刚和一些Microsoft人员说过,目前尚不可行,他们希望添加下一个api版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.