mIRC Home    About    Download    Register    News    Help

Print Thread
#125095 14/07/05 12:54 PM
Joined: Sep 2004
Posts: 73
S
SteeleR Offline OP
Babel fish
OP Offline
Babel fish
S
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
#125096 14/07/05 01:53 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
#125097 14/07/05 02:54 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
it is possible in a custome @window
Quote:

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.

#125098 14/07/05 02:58 PM
Joined: Sep 2004
Posts: 73
S
SteeleR Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Sep 2004
Posts: 73
10x @MikeChat .. I didn't know about these commands smile
10x smile


HanPeg HanPeg u BuHaru HanPeg nPu noPa}|{eHue kParoM u nAk HanPeg
#125099 14/07/05 03:32 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ah... was thinking he wanted in a normal window. smile


Invision Support
#Invision on irc.irchighway.net
#125100 14/07/05 10:36 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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

#125101 15/07/05 02:04 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
#125102 15/07/05 02:17 PM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
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

Link Copied to Clipboard