Yeah those are true arcade light guns, and based on where it is pointed when you pull the trigger (which is why there is always a flash), it tracks the position.
In actual light gun games it is not constantly tracking where you are pointing. It strictly tracks the point only when the trigger is pulled, because that is the only time you care about it. It's either on screen or off screen (reload in most games). I don't know if you played games like Revolution X or Terminator 2 back in the day, but if you recall, those guns were mounted. Those games also had a cursor on screen. That's because they were not true light guns. They were glorified analog sticks basically.
In that video above however, I am running Windows 10 Pro. There is a special piece of hardware from an arcade game called America's Army that came out nearly 20 years ago, called USB2GUN, that allows Windows to recognize the guns as analog controllers. In this case however, Windows is "always" tracking. However, if you are not on a bright screen, it will not track real time just because it can't see the bright screen to calculate the point it is aimed at. But again, for gun games, that doesn't matter at all - as long as that flash happens on trigger pull, that is all that matters.
That piece of hardware is where the flash is coming from too. It's not part of Windows or emulator doing it. Those USB2GUN boards are basically unobtanium at this point though, so I'm fortunate to have picked one up a few years ago with this project in mind.
EDIT:
Here is a video of real time tracking after I implemented it into the emulator, just to see if it actually worked. It's only tracking though because as you can see it's a completely white screen that is on this tester software I am running. But yup, it works!