Restrict mouse movement over a specified window handle

后端 未结 2 781
鱼传尺愫
鱼传尺愫 2021-01-22 10:31

I\'m looking to simulate a kiosk mode for Safari on Windows. OSX will not work with my input hardware and Chrome\'s GPU acceleration is too slow for the machine I\'m using.

相关标签:
2条回答
  • 2021-01-22 11:13

    You can poll the cursor position and correct it using a timer, but this is not ideal. You could also cover the top bar by a transparent topmost window. This way, input will never reach the top bar.

    EDIT: If Internet explorer is an option you have the possibility to use the COM object to embed what you need in a custom application. Other browsers might have similar APIs, but I'm not familiar with them.

    0 讨论(0)
  • 2021-01-22 11:16

    You can use the ClipCursor function to do this.

    Confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area.

    0 讨论(0)
提交回复
热议问题