mIRC Home    About    Download    Register    News    Help

Print Thread
#168030 02/01/07 11:42 PM
Joined: Jan 2005
Posts: 192
Brax Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jan 2005
Posts: 192
I have series of aliases to control my popups...
They enable/disable submenus on specified conditions (whether I'm opped or not, whether i'm in certain server/network or not, etc...)

What I need is a way how to "override" alias in some situations.
eg. I want to display menu group for channel operator even when alias which checks my status will disable the menugroup.

There is $ctrlenter for "ON INPUT".
But is there something I can use for aliases? Like if Control (or shift) is pressed when alias is called it will return something else?

Something like:

alias something {
if ($ctrldown) { return one thing | halt }
else { Return something else }
}



echo -a $signature
Brax #168032 03/01/07 12:38 AM
Joined: Dec 2004
Posts: 66
B
Babel fish
Offline
Babel fish
B
Joined: Dec 2004
Posts: 66
I don’t know if this will fit your situation, but check out $prop under /help Custom Identifiers

alias something {
if ($prop == override) { return one thing | halt }
else { Return something else }
}

Brax #168033 03/01/07 12:44 AM
Joined: Dec 2004
Posts: 66
B
Babel fish
Offline
Babel fish
B
Joined: Dec 2004
Posts: 66
oh, and you don't need a halt after a return

Bob57 #168105 03/01/07 08:51 PM
Joined: Jan 2005
Posts: 192
Brax Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jan 2005
Posts: 192
I don't really see how .prop could help me with this situation.
It doesn't "catch" keypresses.

And I like halt blush
It's just personal preference. It gives me better overview of what is going on if I need to dig through hundreds of lines.


echo -a $signature
Brax #168107 03/01/07 09:19 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Simple answer: There's no way to detect modifier keys from within an alias.

If the person has to call the alias with the modifier key anyway why not just use a different alias or an additional switch/parameter instead? If it's for the ease-of-use thing you could use the specialised F-key aliases so that you can then detect F<n>, Ctrl+F<n>, and Shift+F<n> by which alias is called (/f<n>, /cf<n>, /sf<n> respectively).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
I suppose you could use an on input that caught ctrl-enter when the first char was a / and called the alias with a property or just an extra parameter... but that's just nasty. Just call the alias in a different way laugh


Sais
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
There's a way, actually.

From the help file:
Quote:
if ($mouse.key & 2) echo control key is pressed.
if ($mouse.key & 4) echo shift key is pressed.
if ($mouse.key & 8) echo alt key is pressed.

It's a little awkward that the modifier detection is exclusively associated to a mouse-related identifier, but there it is.

Last edited by cold; 03/01/07 10:05 PM.

* cold edits his posts 24/7
cold #168111 03/01/07 10:11 PM
Joined: Jan 2005
Posts: 192
Brax Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jan 2005
Posts: 192
YES!!! laugh

Thats what I was looking for!

alias something {
if ($mouse.key & 2) { return one thing | halt }
else { Return something else }
}

Thanks =)


echo -a $signature
cold #168120 04/01/07 01:43 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I thought they only worked when related to picwin events (hence being listed in the helpfile under Picture windows). Have they always worked outside of picwins?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Yeah, that's what I used to think too... but then someday I've tested them outside of picwins, just for the sake of a trial, and they worked.

I believe they've always worked outside, but I don't know for sure. I know it's been a long time since I've tested, though... mIRC's version was 5.4 or something.

Edit: looking through versions.txt, I've found that it was exactly mIRC 5.4 that introduced this: "53.Can now use $mouse outside of picture window events [...]". So yeah, it's not always been like this.


* cold edits his posts 24/7

Link Copied to Clipboard