|
|
Joined: Sep 2004
Posts: 73
Babel fish
|
OP
Babel fish
Joined: Sep 2004
Posts: 73 |
how can i catch the event when i press an arrow key or a letter ? is it possible ?
HanPeg HanPeg u BuHaru HanPeg nPu noPa}|{eHue kParoM u nAk HanPeg
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
There isn't any way to capture a keypress in mIRC by default, with the exception of function keys.
There may be DLLs to do this.
As a note, I've seen keymappers that you could use to map an arrow key to a function key and then mIRC would probably see that as a function key being pressed. I'm not really sure this would be a useful way to do what you need. I just thought I'd bring it up.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
it is possible in a custome @window on KEYDOWN/KEYUP
The on KEYDOWN and on KEYUP events trigger when a user presses or releases a key in a custom window.
Format: on <level>:KEYDOWN:<@>:<key,...,keyN>:<commands> Example: on 1:KEYDOWN:@:*:echo User pressed key $keyval in $active
Examples
on 1:KEYDOWN:@frog:32:echo user pressed space bar in @frog
This triggers when when a user presses the spacebar key in window @frog.
on 1:KEYDOWN:@:37,38,39,40:echo pressed cursor key $keyval $keyrpt
This triggers when a user presses any of the cursor keys in any window.
$keyval returns the key code of the key being pressed.
$keychar returns the actual letter of the key being pressed.
$keyrpt returns 1 if the key is repeating due to a user holding down the key.
|
|
|
|
Joined: Sep 2004
Posts: 73
Babel fish
|
OP
Babel fish
Joined: Sep 2004
Posts: 73 |
10x @MikeChat .. I didn't know about these commands  10x 
HanPeg HanPeg u BuHaru HanPeg nPu noPa}|{eHue kParoM u nAk HanPeg
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Ah... was thinking he wanted in a normal window. 
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I think it was for normal windows, but one request was for the arrow keys and I think this says it will capture those:
on 1:KEYDOWN:@:37,38,39,40:echo pressed cursor key $keyval $keyrpt
This triggers when a user presses any of the cursor keys in any window.
I didnt try it though
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Interesting. I thought the only keys we could get in the main windows were function keys and CTRL (as a mousekey).
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Apr 2004
Posts: 871
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 871 |
And that is indeed the case - the "any window" bit from /help on KEYDOWN refers to custom windows only, as does the rest of that helpfile page.
Saturn, QuakeNet staff
|
|
|
|
|
|