Don't get me wrong, I have exactly the same issue because I'm always working with the browser version on Linux. But I have no idea if this is technically possible with browser APIs.
AFAIK, JS is able to get events like mousemove, mousedown, keydown, scroll, touchstart like this:
document.addEventListener('mousemove', () => lastActivity = Date.now());
But this only works if it has focus, so only detects if you are working with Teams currently. It is not able to detect if you are working outside the browser. Only X knows. It's a natural restriction of browsers.
Microphone and camera are dedicated permissions. The browser can't capture the camera that is used by some other application. It can only request the dedicated access to the device, then it's blocked for other applications afaik.
But then, your example with full screen sharing also confuses me, as this is breaking all that permission design and the browser can see everything. So based on that it might be possible somehow to detect mouse movements from the system if the user is allowing such a thing.
But I'm going to ask the Firefox devs...