mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello

can I associate right/left keyboard arrows with aliases?

thanks!

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You can only do that in a custom @window.

Code:
on *:KEYDOWN:@window:37:{ ;Pressed LEFT arrow }
on *:KEYDOWN:@window:39:{ ;Pressed RIGHT arrow }


For more information, use: /help on keydown

-genius_at_work

Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks genius!

can you tell me if I can associate right/left arrows with this aliases you wrote?

Code:
alias F2 shift -1

alias F3 shift 1

alias shift {

  ; 1: <1=left 0=same >1=right

  ;

  var %wname, %wlist, %wtype, %ccid = $cid, %cwin = $active

  var %a = 0, %aa = $scon(0), %c = 0, %cc = 0, %n = 0, %nwin = 0

  while (%a < %aa) {

    inc %a

    scon %a

    %c = 0

    %cc = $window(*,0)

    while (%c < %cc) {

      inc %c

      %wtype = $window(*,%c).type

      if ($istok(chat custom fserv get send,%wtype,32)) continue

      %wname = $window(*,%c)

      inc %n

      if ((%ccid == $cid) && (%cwin == %wname)) %nwin = %n

      %wlist = $addtok(%wlist,$+($cid,.,%wname),44)

    }

    scon -r

  }

  ;

  if (%nwin == 0) {

    %nwin = $findtok(%wlist,$wildtok(%wlist,$+($cid,.*),1,44),1,44)

    %nwin = $calc(%nwin + $wildtok(%wlist,$+($cid,.*),0,44))

    if ($1 > 0) dec %nwin

  }

  if ($1 < 0) {

    dec %nwin

    if (%nwin == 0) dec %nwin

  }

  elseif ($1 > 0) {

    inc %nwin

    if (%nwin == 0) inc %nwin

  }

  %nwin = $calc(((%nwin - 1) % $numtok(%wlist,44)) + 1)

  ;

  %nwin = $gettok(%wlist,%nwin,44)

  if (%nwin != $null) scid $gettok(%nwin,1,46) window -a $+(",$gettok(%nwin,2,46),")

}  


in this post

associations

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
As far as I can tell, it is not possible to use the arrow keys (or any other keys besides F1-F12) to activate aliases in any non-custom window. In other words, the KEYDOWN/KEYUP events only work in custom @windows. As a result, the arrow keys cannot be used to call the referenced alias by using default mIRC commands and identifiers. It may be possible to use some sort of DLL to read the keypress events, however, I don't know anything about DLLs. Someone else may be able to help with that, if it is possible at all.

-genius_at_work

Joined: Oct 2003
Posts: 88
B
Babel fish
Offline
Babel fish
B
Joined: Oct 2003
Posts: 88
Youd also run into a trick spot when you where typing something, and you wanted to move the input cursor using the arrow keys. I personaly use ctrl+shift+left-arrow alot when Im typing, but mabie thats just me.


Basicer - Windows 7 Business x86
Joined: Feb 2006
Posts: 164
V
Vogon poet
Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
I'm not sure how far this can go, but i used to use this to open things like alt + r and alt +b etc

look here

credits to qwerty.


Link Copied to Clipboard