Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Support
  • Code University
  • Another Konami Code
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
Another Konami Code; slayer's didn't work in IE :P
Tweet Topic Started: May 25 2009, 10:43 AM (182 Views)
Agent Moose May 25 2009, 10:43 AM Post #1
Member Avatar
SMF for Free Moderator

Posts:
838
Group:
Former Staff
Member
#14
Joined:
Jul 9, 2008
Code:
 
<script type="text/javascript">
function Konami(code,callback){
var The = "", konami = code;
window.document.onkeydown = function(e){
The += e ? e.keyCode : event.keyCode;
if(The == konami.split(",").join("")) window.location.href = callback;
};};
Konami("38,38,40,40,37,39,37,39,66,65","http://google.com");
</script>

Since slayers Konami Code only worked in FF, at least for me, I decided to make on that works in IE and FF.

Only problem I have with it are the actual key codes :P I tried making it so you can use up,down,left or right, but didn't seem to work. So if someone can get that to work, that would be great :)
You could call me Troy :P | The World of Moosey | Newest Blog: SMF for Free Spam Code

Current Project: Zetaboard Javascript Tester (click on the link in the Submenu)

ZetaBoard Javascript Tester Features:
- Code Test box
- Counts how many open brackets/parentheses and closed brackets/parentheses you have in your code to make sure that your code will work.
- New: Inspect Element
Offline Profile Goto Top
 
Reid May 28 2009, 05:51 PM Post #2
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
In reality, the keycodes are the only type of input testing you can reliably count on. That being said, you would have to loop through a multidimensional array and check the names of the keys (with a .toLowerCase() for user setup) and then grab the key codes using that.
The Resource Board
Offline Profile Goto Top
 
slayer766 May 29 2009, 03:26 PM Post #3
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
Have you tried alerting the code for IE to see if you have the right keycodes?
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Code University · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 7:47 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy