mIRC Home    About    Download    Register    News    Help

Print Thread
#86964 15/06/04 11:16 AM
Joined: Apr 2004
Posts: 2
C
CrashB Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
C
Joined: Apr 2004
Posts: 2
it appears that monitor support seems to fumble up the $mouse.dx and $mouse.dy functions.

In a script, I had a floating window that could be dragged around the screen. It relies on the desktop coordinates to place itself accordingly with the mouse movements. In single monitor support, it seems to work flawlessly, but with dual monitor support, it disaapears occasionally and moves in funny ways.

Now, I do not have dual monitors, nor have I been able to test it to much, but what I have found out from teh little testing I have done is that $mouse.dx and $mouse.dy seem to relay the last pixel in your resolution.

I.E. If your mouse is beyond 1024 and you try and find out how far, it will say 1024.

But thats not all. If your monitors are at two different resolutions, it really starts to act weird. The two monitors I got to test with seemed to make the window entirely disappear and reappear.

One descent sollution I can think of it the added support of dual monitors to the $mouse alias, in the form of something like $mouse.desktop, so that I can find which desktop to draw the icon on. Also, in the placement of a window, there should be a coordinate added to refer to which desktop. Possibly have it to where the default desktop is 1 or the such, and have a switch to say "hey! I am referring to a desktop in here!"

None the less, its kind of a troublesome bug, and hopefully can be looked into.

Joined: Jul 2014
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2014
Posts: 34
Sorry to revive such an old topic, but has anyone found a work around to this?

I have tested the following with having my second monitor on the right side of the main and on top (with both having the same resolution).

$window(-1).dw/dh
returns 1920/1080

$mouse.dx/dy
returns x,y independent of monitor (x: 0 to 1920, y: 0 to 1080)

$window(-2).dx/dy
when mIRC is moved around on main monitor returns the following:
returns (x: 0 to 1920, y: 0 to 1080)

when mIRC is moved around on second monitor set to the right (side to side):
returns (x: 1920 to 3840, y: 0 to 1080)

when mIRC is moved around on second monitor set to the top:
returns (x: 0 to 1920, y: -1080 to 0)

one can move a window by command (/window) from monitor to monitor depending on the coordinates given.

example:
(depending on how you set up the monitors)

Code:
/window -d @test
; set window to (0,0) of second monitor when set to the top:
/window @test 0 -1080
; set window to (0,0) of second monitor when set to the right:
/window @test 1920 0


$window(@test).dx/dy
acts just like $mouse.dx/dy returning only a value from 0 to $window(-1).dw/dh

Tested on Windows 10 Home and mIRC 7.52

as the previous post mentions (CrashB) it is impossible to move a window round multiple monitors relying on $mouse.dx/dy

to me the best solution would be just to return values like $window(-2).dx/dy for $window(@name).dx/dy and $mouse.dx/dy

Last edited by SykO; 13/08/18 12:59 AM.
Joined: Jul 2006
Posts: 4,146
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,146
What's wrong exactly? That post is old, mIRC supports dual monitors fine here. In scripts $mouse.cx $mouse.cy can be used to handle them


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2014
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2014
Posts: 34
oh, you are right. I just did not know what .cx/.cy did exactly (not in mIRC's documentation) should have read wikichip. thank you for taking the time and answering this, much appreciated.

Incase someone else was wondering (not documented): .cx and .cy also works on $window(@custom).cx/cy

Last edited by SykO; 13/08/18 02:17 AM.
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
nice find. added .cx .cy to $window() on wikichip.

ok, I tried to add it to wikichip, but the site doesn't allow edits anymore, even when logged in. so I posted to the page's discussion tab.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jul 2006
Posts: 4,146
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,146
It does allow edits, just a bullshit spam filters system which triggers new expression for old text. I added .cx and .cy to $window.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard