You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short summary
Hi,
I am creating a Remote-Access feature for my chat app. Everything works as expected. But for moving the mouse on the Secondary display I am unable to find any API in nutjs documentation. If I have connected a secondary display, then the mouse.move() only works on the primary screen. Need to know whether this is supported or not? If not, then where can I get started to make mouse.move accept a screenId input so that we can move the mouse in the secondary display as well.
The text was updated successfully, but these errors were encountered:
SibaPrasadTech
changed the title
Moving the mouse on Second screen when an Additional Monitor is connected
Moving the mouse on Secondary Display when an Additional Monitor is connected
May 2, 2023
If not, then where can I get started to make mouse.move accept a screenId input so that we can move the mouse in the secondary display as well
I don’t think this additional parameter is needed.
You can pass whatever coordinates you want to mouse.move, but you’d have to make sure the underlying provider is able to handle it.
I'm doing a similar thing. You will want to offset your coordinates by the share'd display's bounds.x and bounds.y values.
As far as the mouse is concerned all the screens are one big canvas and the x and y go across all of them. Primary monitor upper left corner is always 0, 0. All other monitors are relative to that. So, if the primary monitor is on the left, is 1920px wide, and the second monitor is to the right of that, the first x pixel on the second monitor is 1921px. If the second monitor was on the left the rightmost pixel on that monitor would be a x = -1px.
In my case, I use the screen.getAllDisplays() from Electron and find the display being shared, and look at screen.bounds.x and y and add/subtract to the value being passed in.
Short summary
Hi,
I am creating a Remote-Access feature for my chat app. Everything works as expected. But for moving the mouse on the Secondary display I am unable to find any API in nutjs documentation. If I have connected a secondary display, then the mouse.move() only works on the primary screen. Need to know whether this is supported or not? If not, then where can I get started to make mouse.move accept a screenId input so that we can move the mouse in the secondary display as well.
The text was updated successfully, but these errors were encountered: