Focus can't be set on Logitech MX Brio

in that case, I’d recommend keeping the program running, showing live video continuously with cv.imshow() and companion functions

you can easily handle mouse clicks or any key presses while the image window is active.