HotKeys jQuery Plug-In version 0.7 is out

Last night I released a new comprehenced version of jshotkeys. This plugin lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.
For example, to bind Ctrl+C to a function fn simply type:

$(document).bind('keydown', 'Ctrl+c', fn);

See the live demo.


jQuery vs. Prototype

just put both libraries on wordle to visualize on which each library have focused.

Here are the results:

jQuery

jquery-1.2.6

Prototype

prototype visualized


New Version for JS HotKeys

I finally was able to fix a few minor bugs and compile a new version of my js-hotkeys module. Get your copy now (tar.gz || zip)

Js-Hotkeys is a jQuery plugin that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.

Read more at:
http://code.google.com/p/js-hotkeys/wiki/about
Live demo at:
http://jshotkeys.googlepages.com/test-static.html


Getting things right vs. Getting things done

Most of today’s web developer will tell you that

the following:

<h2 id="foo">Click Here</h2>
<script>
    $('foo').click = function(){alert("Hello")};
</script>

is better than:

<h2 id="foo" onclick="alert('Hello');">Click Here</h2>

and the following:

<style>
body{
    background-color:#ffffff;
    color:#000000;
    margin-top:3}
a{color:#0000cc}
a:visited{color:#551a8b}
</style>
<body>....</body>

<script>
$(document).ready(function(){
    sf();
    if(document.images){
        new Image().src='/images/nav_logo3.png';
    });
</script>

is far better than:

<body bgcolor=#ffffff
text=#000000
link=#0000cc
vlink=#551a8b
alink=#ff0000
onload="sf();if(document.images){new Image().src='/images/nav_logo3.png'}"
topmargin=3 marginheight=3>....</body>

and last but not least: Using HTML tables for layout-ing is evil.

The point is that the code above is taken from Google, Facebook and Yahoo.
Yep! All the majors seems to be caring less on standards and more for their own interests.

None of them are valid HTML and Google.com uses a table to align the two buttons (Google Search and I’m felling Lucky) in the middle of the page.


HotKeys

jQuery Keyboard Shortcut Hooker Plugin is now called Hotkeys. Make sense, right? The script was tested on Linux, Windows, and MacOS, IE, Safari and Firefox.

The final result is relatively small file (121 lines of code). But do not let this fact misleading you by underestimating its value.

> See Live Demo  

Read more at Google Code and jQuery Plugin Repository


jQuery Plugin for Keyboard Hooking.

I rewrote (granted permissions by author) the great JavaScript module by Binny V A shortcut.js as a jQuery plug-in.

Code Sample and download a pre alpha version are available at Google Code

Cheers,