obs-zoom-and-follow icon indicating copy to clipboard operation
obs-zoom-and-follow copied to clipboard

KeyError: 1 in update_monitor_dim

Open ngriffin7a opened this issue 2 years ago • 1 comments

I'm using OBS 27.2.4 on a Mac with MacOS 12.5, and /Library/Frameworks/Python.framework/Versions/3.9

I setup a hotkey of Command+Z, and when I press it, I get the following error in a popup:

[zoom_and_follow_mouse.py] Source Type: display_capture [zoom_and_follow_mouse.py] Retrieving monitor 1 [zoom_and_follow_mouse.py] Updating stored dimensions to match selected monitor's dimensions [zoom_and_follow_mouse.py] Traceback (most recent call last): [zoom_and_follow_mouse.py] File "/Users/ngriffin/Projects/sales-engineering/screencasts/python-scripts/zoom_and_follow_mouse.py", line 668, in toggle_zoom [zoom_and_follow_mouse.py] zoom.update_source_size() [zoom_and_follow_mouse.py] File "/Users/ngriffin/Projects/sales-engineering/screencasts/python-scripts/zoom_and_follow_mouse.py", line 221, in update_source_size [zoom_and_follow_mouse.py] self.update_monitor_dim(self.monitors[self.monitors_key[monitor_index]]) [zoom_and_follow_mouse.py] File "/Users/ngriffin/Projects/sales-engineering/screencasts/python-scripts/zoom_and_follow_mouse.py", line 84, in update_monitor_dim [zoom_and_follow_mouse.py] if self.source_w != monitor[1]['size'].width or self.source_h != monitor[1]['size'].height or self.source_x != monitor[1]['pos'].x or self.source_y != monitor[1]['pos'].y:
[zoom_and_follow_mouse.py] KeyError: 1

I'd be much obliged if you think it's a bug, or if there might be a way to wokraround the problem.

Thank you, Neil

ngriffin7a avatar Aug 17 '22 01:08 ngriffin7a

I'm not particularly capable of debugging on the Mac side as I don't have a Mac environment to test in. @bpatram would you have any insight as to if this is an issue I had caused with a recent change or if it's a different Mac/OBS/Python issue altogether?

EDIT: Scratch that, It's an addition I made, that didn't account for MacOS use. I'll try to dig through pywinctl to see how it reports Mac screen info and see if there's a change I can make.

This should be addressed now as of https://github.com/tryptech/obs-zoom-and-follow/commit/03d463e10e2c8843d501407d57c741509478f1ce. Please give it a try and let me know your results.

tryptech avatar Aug 17 '22 02:08 tryptech

Closing for now, stale

tryptech avatar Sep 08 '22 12:09 tryptech