In many multimonitor setups featuring monitors of varying stand heights, the vertical positions of the monitors can be adjusted in software so that their graphics align correctly. A vertical displacement is added to the Windows mouse coordinates to give this effect; shown in purple in the diagram:
I am building a program that needs to know when the user's mouse has reached the top of any of their monitors. I tried using
MouseInfo.getPointerInfo().getLocation().y==0
, but this will not work when the monitors have been displaced in software because the top of the monitor may not always be zero.
Is there a reliable and efficient way to identify this offset across multiple displays?