开发者

Keep mouse pointer within frame/window

I want to prevent the mouse from being moved out of the window. I've seen it done before on Minecraft, where you have to press esc to release the mous开发者_开发问答e from the window.


In Java you can use the Class Robot to position the mouse cursor anywhere on the screen. You could use this to move the mouse position back to the center after each mouse move event.

//Moves mouse pointer to given screen coordinates.
void mouseMove(int x, int y)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜