It is currently Fri Mar 29, 2024 12:25 am


The forum is READ ONLY. Please direct any future discussions to our Facebook page


 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Typing in shout box activates HOTKEYS
PostPosted: Sun Mar 28, 2004 10:32 am 
Newbie
Newbie

Joined: Fri Mar 26, 2004 10:23 am
Posts: 24
Location: Mississauga, ON, CA
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>


Offline
 Profile  
 
 Post subject:
PostPosted: Sun Mar 28, 2004 10:40 am 
Newbie
Newbie

Joined: Fri Mar 26, 2004 10:23 am
Posts: 24
Location: Mississauga, ON, CA
Oh, I'm using the pulldown template.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron