Index: docs/help.html =================================================================== RCS file: /data/cvs/cgiirc/docs/help.html,v retrieving revision 1.4 diff -u -r1.4 help.html --- docs/help.html 15 Jun 2002 21:35:16 -0000 1.4 +++ docs/help.html 27 Aug 2003 13:12:20 -0000 @@ -37,10 +37,15 @@ immediately.

Keyboard shortcuts

-There are several shortcuts to help make using CGI:IRC nicer, tab completion - which will complete a nickname or channel when you press tab, alt+number will - go to that number window if you number the windows from the left (Status = 1 - and so on). +There are several shortcuts to help make using CGI:IRC nicer. + + + + + + +
TabWill autocomplete a nickname or channel.
Ctrl+number / Alt+numberWill go to that number window if you number + the windows from the left (Status = 1 and so on).
Ctrl+B / Ctrl+Alt+B / Ctrl+Alt+Shift+BWrite "%B" for bold text.
Ctrl+B / Ctrl+Alt+C / Ctrl+Alt+Shift+CWrite "%C" for colored text.
Cursor Up/DownMove in the command history.

About CGI:IRC

CGI:IRC is written in Perl by David Leadbeater with help from lots of people. See the 'toggle', info => 'Store all scrollback data (uses more memory)' }, + safeshortcuts => { + type => 'toggle', + info => 'nonconflicting IRC shortcuts' + }, ); sub new { @@ -587,10 +591,15 @@ immediately.

Keyboard shortcuts

-There are several shortcuts to help make using CGI:IRC nicer, tab completion - which will complete a nickname or channel when you press tab, alt+number will - go to that number window if you number the windows from the left (Status = 1 - and so on). +There are several shortcuts to help make using CGI:IRC nicer. + + + + + + +
TabWill autocomplete a nickname or channel.
Ctrl+number / Alt+numberWill go to that number window if you number + the windows from the left (Status = 1 and so on).
Ctrl+B / Ctrl+Alt+B / Ctrl+Alt+Shift+BWrite "%B" for bold text.
Ctrl+B / Ctrl+Alt+C / Ctrl+Alt+Shift+CWrite "%C" for colored text.
Cursor Up/DownMove in the command history.

About CGI:IRC

CGI:IRC is written in Perl by David Leadbeater with help from lots of people. See the
47 && keyCode < 58) { - var num = keyCode - 48; + }else if(((event.altKey && !event.ctrlKey) || (!event.altKey && event.ctrlKey)) && charCode > 47 && charCode < 58) { + // Alt or Ctrl + number is often bound to browser functions + // Ctrl+Alt is totally equal to AltGr on Windows (strange!) + // so use Ctrl+num or Alt+num, whatever the browser passes through + var num = charCode - 48; if(num == 0) num = 10; var name = parent.fwindowlist.witemchgnum(num); Index: interfaces/konqueror.pm =================================================================== RCS file: /data/cvs/cgiirc/interfaces/konqueror.pm,v retrieving revision 1.18 diff -u -r1.18 konqueror.pm --- interfaces/konqueror.pm 18 Jan 2003 00:12:24 -0000 1.18 +++ interfaces/konqueror.pm 27 Aug 2003 13:12:20 -0000 @@ -49,6 +49,10 @@ type => 'toggle', info => 'Store all scrollback data (uses more memory)' }, + safeshortcuts => { + type => 'toggle', + info => 'nonconflicting IRC shortcuts' + }, ); sub new { @@ -348,10 +352,15 @@ immediately.

Keyboard shortcuts

-There are several shortcuts to help make using CGI:IRC nicer, tab completion - which will complete a nickname or channel when you press tab, alt+number will - go to that number window if you number the windows from the left (Status = 1 - and so on). +There are several shortcuts to help make using CGI:IRC nicer. + + + + + + +
TabWill autocomplete a nickname or channel.
Ctrl+number / Alt+numberWill go to that number window if you number + the windows from the left (Status = 1 and so on).
Ctrl+B / Ctrl+Alt+B / Ctrl+Alt+Shift+BWrite "%B" for bold text.
Ctrl+B / Ctrl+Alt+C / Ctrl+Alt+Shift+CWrite "%C" for colored text.
Cursor Up/DownMove in the command history.

About CGI:IRC

CGI:IRC is written in Perl by David Leadbeater with help from lots of people. See the
47 && keyCode < 58) { - var num = keyCode - 48; + }else if(((event.altKey && !event.ctrlKey) || (!event.altKey && event.ctrlKey)) && charCode > 47 && charCode < 58) { + // Alt or Ctrl + number is often bound to browser functions + // Ctrl+Alt is totally equal to AltGr on Windows (strange!) + // so use Ctrl+num or Alt+num, whatever the browser passes through + var num = charCode - 48; if(num == 0) num = 10; var name = parent.fwindowlist.witemchgnum(num); Index: interfaces/mozilla.pm =================================================================== RCS file: /data/cvs/cgiirc/interfaces/mozilla.pm,v retrieving revision 1.58 diff -u -r1.58 mozilla.pm --- interfaces/mozilla.pm 18 Jan 2003 00:12:24 -0000 1.58 +++ interfaces/mozilla.pm 27 Aug 2003 13:12:20 -0000 @@ -49,6 +49,10 @@ type => 'toggle', info => 'Store all scrollback data (uses more memory)' }, + safeshortcuts => { + type => 'toggle', + info => 'nonconflicting IRC shortcuts' + }, ); sub new { @@ -334,10 +338,15 @@ immediately.

Keyboard shortcuts

-There are several shortcuts to help make using CGI:IRC nicer, tab completion - which will complete a nickname or channel when you press tab, alt+number will - go to that number window if you number the windows from the left (Status = 1 - and so on). +There are several shortcuts to help make using CGI:IRC nicer. + + + + + + +
TabWill autocomplete a nickname or channel.
Ctrl+number / Alt+numberWill go to that number window if you number + the windows from the left (Status = 1 and so on).
Ctrl+B / Ctrl+Alt+B / Ctrl+Alt+Shift+BWrite "%B" for bold text.
Ctrl+B / Ctrl+Alt+C / Ctrl+Alt+Shift+CWrite "%C" for colored text.
Cursor Up/DownMove in the command history.

About CGI:IRC

CGI:IRC is written in Perl by David Leadbeater with help from lots of people. See the
47 && keyCode < 58) { - var num = keyCode - 48; + }else if(((event.altKey && !event.ctrlKey) || (!event.altKey && event.ctrlKey)) && charCode > 47 && charCode < 58) { + // Alt or Ctrl + number is often bound to browser functions + // Ctrl+Alt is totally equal to AltGr on Windows (strange!) + // so use Ctrl+num or Alt+num, whatever the browser passes through + var num = charCode - 48; if(num == 0) num = 10; var name = parent.fwindowlist.witemchgnum(num); Index: interfaces/interface-make/fform.pm =================================================================== RCS file: /data/cvs/cgiirc/interfaces/interface-make/fform.pm,v retrieving revision 1.4 diff -u -r1.4 fform.pm --- interfaces/interface-make/fform.pm 24 Nov 2002 19:02:06 -0000 1.4 +++ interfaces/interface-make/fform.pm 27 Aug 2003 13:12:20 -0000 @@ -33,7 +33,7 @@ function load() { fns(); document.getElementById('extra').style.display = 'none'; -.$just ie +.$just ie konqueror document.onkeydown = enter_key_trap; .$else document.onkeypress = enter_key_trap; @@ -74,22 +74,42 @@ } function enter_key_trap(e) { - if(e == null) { - return keypress(event.srcElement, event.keyCode, event); - }else{ - // mozilla dodginess - return keypress(e.target, e.keyCode == 0 ? e.which : e.keyCode, e); + if(e == null) { // MSIE + return keypress(event.srcElement, event); + }else{ // Mozilla, Netscape, W3C + return keypress(e.target, e); } } -function keypress(srcEl, keyCode, event) { +function keypress(srcEl, event) { if (srcEl.tagName != 'INPUT' || srcEl.name.toLowerCase() != 'say') return true; + var charCode = event.charCode; // MSIE: undef, Mozilla: different when shifted + var keyCode = event.keyCode; // the only one in MSIE, Mozilla: only special keys (up, down, etc) + var which = event.which; // the only one in NN + + if(keyCode == null) { // NN + charCode = which; + if(which < 32) keyCode = which; + // NN only has charcodes (and some special keys below 32, i.e. Esc) + } + if(charCode == null) charCode = keyCode; // MSIE - if(keyCode == 66 && event.ctrlKey) { - append('\%B'); - }else if(keyCode == 67 && event.ctrlKey) { - append('\%C'); + if((charCode == 66 || charCode == 98) && event.ctrlKey) { + // in NN/Mozilla charcodes are case sensitive + if(parent.fwindowlist.options['safeshortcuts'] == true) { // use Ctrl+Alt, not Ctrl + if(event.altKey) { append('\%B'); } + else { return true; } + }else { + append('\%B'); + } + }else if((charCode == 67 || charCode == 99) && event.ctrlKey) { + if(parent.fwindowlist.options['safeshortcuts'] == true) { + if(event.altKey) { append('\%C'); } + else { return true; } + }else { + append('\%C'); + } }else if(keyCode == 9) { // TAB var tabIndex = srcEl.value.lastIndexOf(' '); var tabStr = srcEl.value.substr(tabIndex+1 || tabIndex).toLowerCase(); @@ -128,14 +148,14 @@ tabpos = (tabIndex == -1 ? 0 : tabIndex + 1) + tablen; tabinc = 1; } - }else if(keyCode == 38) { // UP + }else if(keyCode == 38) { // UP, doesn't work in NN if(!shistory[hispos]) { if(document.myform["say"].value) hisadd(); hispos = shistory.length; } hispos--; hisdo(); - }else if(keyCode == 40) { // DOWN + }else if(keyCode == 40) { // DOWN, dito if(!shistory[hispos]) { if(document.myform["say"].value) hisadd(); document.myform["say"].value = ''; @@ -143,8 +163,11 @@ } hispos++; hisdo(); - }else if(event.altKey && !event.ctrlKey && keyCode > 47 && keyCode < 58) { - var num = keyCode - 48; + }else if(((event.altKey && !event.ctrlKey) || (!event.altKey && event.ctrlKey)) && charCode > 47 && charCode < 58) { + // Alt or Ctrl + number is often bound to browser functions + // Ctrl+Alt is totally equal to AltGr on Windows (strange!) + // so use Ctrl+num or Alt+num, whatever the browser passes through + var num = charCode - 48; if(num == 0) num = 10; var name = parent.fwindowlist.witemchgnum(num); Index: interfaces/interface-make/main.pm =================================================================== RCS file: /data/cvs/cgiirc/interfaces/interface-make/main.pm,v retrieving revision 1.8 diff -u -r1.8 main.pm --- interfaces/interface-make/main.pm 18 Jan 2003 00:12:24 -0000 1.8 +++ interfaces/interface-make/main.pm 27 Aug 2003 13:12:20 -0000 @@ -49,6 +49,10 @@ type => 'toggle', info => 'Store all scrollback data (uses more memory)' }, + safeshortcuts => { + type => 'toggle', + info => 'nonconflicting IRC shortcuts' + }, ); sub new { Index: interfaces/interface-make/make-js-interfaces.pl =================================================================== RCS file: /data/cvs/cgiirc/interfaces/interface-make/make-js-interfaces.pl,v retrieving revision 1.1 diff -u -r1.1 make-js-interfaces.pl --- interfaces/interface-make/make-js-interfaces.pl 2 Oct 2002 16:15:18 -0000 1.1 +++ interfaces/interface-make/make-js-interfaces.pl 27 Aug 2003 13:12:20 -0000 @@ -27,6 +27,7 @@ if(/^\.\$?(\w+)(?: (.*))?/) { # The $ is so the variables get syntax hilighted :) my($cmd, $param) = ($1, $2); + my @params = split(' ', $param); if($cmd eq 'include') { open(INC, $param) or die "$param: $!"; @@ -39,17 +40,17 @@ close(SUB); out_cur("}\n"); }elsif($cmd eq 'just') { - for(keys %current) { - $current{$_} = 0; - if($_ eq $param) { - $current{$_} = 1; + for my $current (keys %current) { + $current{$current} = 0; + if(scalar(grep(/$current/, @params))) { + $current{$current} = 1; } } }elsif($cmd eq 'not') { - for(keys %current) { - $current{$_} = 1; - if($_ eq $param) { - $current{$_} = 0; + for my $current (keys %current) { + $current{$current} = 1; + if(scalar(grep(/$current/, @params))) { + $current{$current} = 0; } } }elsif($cmd eq 'end') {