Login   Register  
Icontem

File: simple_example.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Arturs Sosins  >  Keyboard Shortcut  >  simple_example.html  >  Download  
File: simple_example.html
Role: Example script
Content type: text/plain
Description: Simple example of class usage
Class: Keyboard Shortcut
Invoke functions when multiple keys are pressed
Author: By
Last change:
Date: 2011-06-21 13:06
Size: 906 bytes
 

Contents

Class file image Download
<!--
/*************************************************************
 * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
 * Feel free to distribute and modify code, but keep reference to its creator
 *
 * Keyboard shortcut class provides ability to bind functions
 * to custom key combinations.
 *
 * For more information, examples and online documentation visit: 
 * http://webcodingeasy.com/JS-classes/Multiple-key-combinations-using-javascript
**************************************************************/
-->
<html>
<head>
</head>
<body>
<h1 style='text-align: center;'>Just try pressing Ctr+Alt+A</h1>
<script type="text/javascript" src="./kb_shortcut.packed.js" ></script>
<script type="text/javascript">
var kb = new kb_shortcut();
kb.add(["Ctrl", "Alt", "A"], function(){
	alert("Key combination activated");
})
</script>
</body>
</html>