I'm using a Mac, Safari 1.2.1 - When I type in the shout box, the hotkeys are not ignored.
Bellow is a sample of code from another PHP project, Legend of the Green Dragon, (
http://sourceforge.net/projects/lotgd) where they have a text box and hotkeys are ignored. This script works correctly under Safari.
<script language='JavaScript'>
<!--
document.onkeypress=keyevent;
function keyevent(e){
var c;
var target;
var altKey;
var ctrlKey;
if (window.event != null) {
c=String.fromCharCode(window.event.keyCode).toUpperCase();
altKey=window.event.altKey;
ctrlKey=window.event.ctrlKey;
}else{
c=String.fromCharCode(e.charCode).toUpperCase();
altKey=e.altKey;
ctrlKey=e.ctrlKey;
}
if (window.event != null)
target=window.event.srcElement;
else
target=e.originalTarget;
if (target.nodeName.toUpperCase()=='INPUT' || target.nodeName.toUpperCase()=='TEXTAREA' || altKey || ctrlKey){
}else{
if (c == 'F') { window.location='forest.php?c=5-112401';; return false; }
if (c == 'B') { window.location='train.php?c=5-112401';; return false; }
if (c == 'S') { window.location='pvp.php?c=5-112401';; return false; }
if (c == 'H') { window.location='hof.php?c=5-112401';; return false; }
if (c == 'W') { window.location='weapons.php?c=5-112401';; return false; }
if (c == 'A') { window.location='armor.php?c=5-112401';; return false; }
if (c == 'Y') { window.location='bank.php?c=5-112401';; return false; }
if (c == 'T') { window.location='gypsy.php?c=5-112401';; return false; }
if (c == 'I') { window.location='inn.php?c=5-112401';; return false; }
if (c == 'M') { window.location='stables.php?c=5-112401';; return false; }
if (c == 'G') { window.location='gardens.php?c=5-112401';; return false; }
if (c == 'C') { window.location='rock.php?c=5-112401';; return false; }
if (c == '?') { window.open('petition.php?op=faq&c=5-112401','petitionphpopfaqc5112401','scrollbars=yes,resizable=yes,width=550,height=300'); return false; }
if (c == 'D') { window.location='news.php?c=5-112401';; return false; }
if (c == 'P') { window.location='prefs.php?c=5-112401';; return false; }
if (c == 'L') { window.location='list.php?c=5-112401';; return false; }
if (c == 'Q') { window.location='login.php?op=logout&c=5-112401';; return false; }
}
}
//-->
</script>