mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
The flag '16' for $mouse.key (to check whether the right mouse button is pressed) is new in 6.17, and a very nice addition at that. I think it would be even more useful if the following minor change were made...

Currently, on ^HOTLINK (note the ^) triggers if you move your mouse over a word, but it also triggers when you left-click on a word without moving the mouse. This is pretty nice, since it allows a script to check ($mouse.key & 1) and take some action (e.g. show a tooltip) for the word that is being single-clicked on. However, on ^HOTLINK currently does not trigger when you right-click on a word. I would like to request that on ^HOTLINK also be triggered in that case, so that a script can check ($mouse.key & 16) and perform an action if this is the case.

In short, this would allow us to use a custom popup dll (e.g. XPopup) to create our own popup menus for hotlinked words.

For once I'm interested in (proper) workarounds here, too.. smile


Saturn, QuakeNet staff
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Great idea! smile Supported 100%
No workarounds though I'm afraid.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I agree, I'd like on ^hotlink to trigger on "right button down". However, it does trigger on "right button up", which makes this workaround possible:
Code:
on ^*:hotlink:*matchtext*:*:{
  var %a = $+(%,hotlinksclick,$window($active).wid)
  if $mouse.key & 1 { set -u10 $(%a) 1 }
  elseif $(%a,2) { unset $(%a) }
  elseif $mouse.x $mouse.y == %mousecoords { [color:red]YOUR POPUP CODE HERE[/color] }
  set -u120 %mousecoords $mouse.x $mouse.y
}
It doesn't even need $mouse.key & 16, so it works on older mirc versions too... which makes me wonder why I haven't used it so far.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Oh wow, nice! Unfortunately that will also trigger occassionally when the RMB wasn't pressed at all, e.g. if you move your mouse over the word, then out of the window, and then back into the window on the word. On the other hand, I hadn't thought at all about the fact that menus pop up when you release the RMB instead of when you press it!

It seems to me that a combination of my feature suggestion and your snippet would provide the optimal solution here...

Edit well, not entirely optimal, but still as good as it will get without an identifier that states what mouse event triggered on ^HOTLINK. But maybe that's a little too much to ask for..

Last edited by Sat; 19/02/06 03:14 PM.

Saturn, QuakeNet staff
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Yeah, although these occasions are rare, they are a bit more frequent when a line starts with the hotlink text, so if your mouse was on position x=1 (for that window), then you move it to the left (out of the window) and back in, it triggers. I can't think of a way around this atm (the "leave" event doesn't trigger for non-picture windows unfortunately). I guess you could whip up something with timers, but it won't look pretty.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard