obs-zoom-to-mouse icon indicating copy to clipboard operation
obs-zoom-to-mouse copied to clipboard

Add support for Window Capture sources

Open BlankSourceCode opened this issue 1 year ago • 1 comments

Currently this script only works with Display Capture sources (aka when you are capturing a whole monitor display in OBS).

My theory is that we could support other sources (such as Window Capture) if we had a reliable way to get the size and offset of that window for use with the mouse position calculations.

We currently get the mouse position in terms of the desktop area, but when you zoom, we need to convert that position into where on the capture source the mouse is. For display captures we use the info given by OBS to parse out the top-left x and y coordinates of the monitor you are using. So when you click at 1921, 0 we know that is really pixel 0,0 on the second monitor because it starts at x 1921.

Would probably require some refactoring of the script especially around the refresh_sceneitem function.

BlankSourceCode avatar Nov 04 '23 23:11 BlankSourceCode

This sort of works due to #9 but you have to manually set the position/size of the source window. Which means if you move the window, you'd have to update the zoom settings again which isn't ideal, but it's at least possible now.

BlankSourceCode avatar Nov 21 '23 21:11 BlankSourceCode