BlankSourceCode / obs-zoom-to-mouse

An OBS lua script to zoom a display-capture source to focus on the mouse
178 stars 15 forks source link

Vertical Monitor #7

Closed gabrielfermy closed 7 months ago

gabrielfermy commented 7 months ago

Hi, first of all i'm very grateful that your solution works for my case. After a few hours trying to resolve issue in the tryptech's solution using python, i find that yours are the only one thats working for me. it even can handle multiple instance to allow me to zoom multiple monitor. So I have another monitor, its actually 1600 by 800 px monitor that i set to vertical. The way i have it able to control zoom for the other monitors is by copying and renaming your script so i can make another instance of it for every monitor i have. its working for all other horizontall 1902 by 1080px monitors. But, when i made copy for my vertical setup, assign it to the monitor, setup a new hotkey for this instance, everytime i toggle the hotkey its giving me this error: [obs-zoom-to-mouse.lua] Failed to call hotkey_pressed for hotkey_pressed: [string "C:/Program Files/obs-studio/data/obs-plugins/..."]:480: attempt to perform arithmetic on field 'x' (a nil value)

i don't know if its a bug or something, and since i don't know lua, i think i need some insights to handle this Thanks

BlankSourceCode commented 7 months ago

Line 480 (on the version I'm guessing you're using) is trying to assign an offset to the mouse position based on the size of the monitor. My guess is that vertical messed up the logic somehow.

To get around it, you could try enabling Set manual monitor position in the settings and update the width,height to the resolution and x,y to the position (top-left corner of screen based on the total desktop size of all your monitors combined) of your monitor.

See if that helps at all.

Also, if you enable debug logs in the settings and then copy/paste the script log into this issue it might help me diagnose what is wrong.

Thanks for trying the script!

BlankSourceCode commented 7 months ago

@gabrielfermy I've updated the script with additional logging to see why it might be failing to get the monitor size/position. Could you grab the latest version, and enable debug logging (in the settings), and reply with the script log?

Also let me know if manually setting the monitor override position helped you at all. Thanks

BlankSourceCode commented 7 months ago

This was probably fixed with #13, so I'm going to close it. If you find that it still happens after updating the script (and also re-adding your display capture source) feel free to open with the debug logs so I can figure out what is happening.

Thanks!