|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
hello
can you tell me please how can I assosiacte F1 and F2 with 'activate the next right tab' and 'activate next left tab' ?
what other keys can I use as hotkeys in mirc?
thanks!
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
2nd question first: Any the F keys can be associated either alone or in combinations with the Shift &/or Ctrl keys From the mIRC help file Function Key support You can redefine function keys to perform certain commands, just like aliases. For example:
/F1 /say Hello! /sF2 /query $1 /cF3 /ctcp $1 version
The s and c prefixes for Shift key and Control key respectively.
Note: A function key will behave differently depending on the window in which it is used. For example, when using it in a query window the $1 parameter refers to the selected users nickname. If you're on a channel and the nickname listbox is active then the function key will work on the selected nicknames. If the listbox is not active, the function key will just work on the channel.
In regards to your first question, I'm going to presume that your tabs are actually part of a dialog that you have. I don't have any codes to test this on, so this is untested F1 {
did -f <dialog name> $calc($dialog(tab) - 1)
}
F2 {
did -f <dialog name> $calc($dialog(tab) + 1)
}
F1 is back one, F2 is forward one. NOTE: There is no error checking to prevent the occurance of invalid ID's Your Tab ID's MUST be in sequential order for this to work.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
* /did: invalid parameters
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
That would be $dialog(<dialog name>).tab
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Thanks Hixxy. I haven't used tabs in my own dialogs yet, so I was going the best I could from the help file and my own knowledge. You correction has been noted, and hopefully, with that, the original poster now has a working code.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
can you tell me the right code please
thank you
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
F1 {
did -f <dialog name> $calc($dialog(<dialog name>).tab - 1)
}
F2 {
did -f <dialog name> $calc($dialog(<dialog name>).tab + 1)
}
Replace <dialog name> with the actual name of the dialog.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
what is the actual name of the dialog????
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I have no way of knowing that, but you must've specified a name for the dialog when you created it. Look in your script for a line that looks like It will be the first line of the section where you create the dialog.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
am I supposed to specify a dialog each time I want to change tab?
maybe you didnt understand me, I want change tabs by pressing F1/F2 for the next right/left tab of the active one
|
|
|
|
Joined: Jan 2006
Posts: 61
Babel fish
|
Babel fish
Joined: Jan 2006
Posts: 61 |
To you get the name of current dialog use the identifier $dname who returns the current dialog name, like this:
on *:dialog:test:sclick:25:{ .echo -a Im clicking on button id $did on $dname dialog }
Explanation:
assuming you have a button with the id 25 on a dialog called teste, when you click on these button then will return Im clicking on button id 25 on teste dialog.
Thats all
*
The practice do the Master...
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
The only place where I've encountered tabs, is in dialogs.
If you aren't using a dialog, then you aren't using the correct term for your reference.
Incorrect information from you will not assist me is helping you resolve problems that you're having.
If you aren't using a dialog, and you don't know the correct term for what it is you're wanting to do, give as detailed a description of your situation, or if possible, provide a screen shot, so that we can see what you mean, and get you the correct terminology and solutions.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
sorry
I consider tab as every box/item that appears in 'switchbar'
maybe I should refrain: I want to change view of windows by F1,F2 (left, right)
a window can be 'the status window', 'a private message query window', 'a channel window'
I borrowed the term 'tab' from web-browser Opera and Firefox...
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
Due to limitations in mIRC, this is the best I can come up with: 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),")
} (Make sure you remove existing F2/F3 aliases) Usage: F2 = scroll left F3 = scroll right /shift -1 = scroll left /shift 1 = scroll right This code should scroll left (F2) and right (F3) through each of the following (compatible) windows: - status windows
- channel windows
- query windows
It will NOT scroll through the following windows: - dcc send windows
- dcc get windows
- dcc chat windows
- fserv windows
- custom windows
However, it WILL scroll off of an incompatible windows to the nearest compatible window (left or right). Let me know if there are any bugs. -genius_at_work
Last edited by genius_at_work; 02/03/06 02:33 AM.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
it works flawlessly so far
THANK YOU VERY MUCH!!
by the way is there any possibility to associate it instead of F2,F3 with the right/left arrow in keyboard?
thanks again!
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
This code should scroll left (F2) and right (F3) through each of the following (compatible) windows: - status windows
- channel windows
- query windows
It will NOT scroll through the following windows: - dcc send windows
- dcc get windows
- dcc chat windows
- fserv windows
- custom windows
However, it WILL scroll off of an incompatible windows to the nearest compatible window (left or right). is it possible to make this code work for query windows only? thank you!
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
Change this line: if ($istok(chat custom fserv get send,%wtype,32)) continue To this: if ($istok(channel status chat custom fserv get send,%wtype,32)) continue -genius_at_work
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
is it possible to make those aliases work only for windows (either channel or query) in which there was recent activity in them? (those that have become red, indicating that a new event has occured eg msg)
thanks!
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
is it possible to make those aliases work only for windows (either channel or query) in which there was recent activity in them? (those that have become red, indicating that a new event has occured eg msg)
thanks! it cannot be done?
|
|
|
|
|