[wp-trac] [WordPress Trac] #19489: Consider updating jquery.hotkeys plugin

WordPress Trac noreply at wordpress.org
Tue Jan 22 19:38:33 UTC 2013


#19489: Consider updating jquery.hotkeys plugin
--------------------------------+-----------------------------
 Reporter:  GaryJ               |       Owner:
     Type:  enhancement         |      Status:  closed
 Priority:  normal              |   Milestone:  Future Release
Component:  External Libraries  |     Version:  3.3
 Severity:  normal              |  Resolution:  fixed
 Keywords:                      |
--------------------------------+-----------------------------
Changes (by vincentastolfi):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 I have been having trouble getting this plugin to work properly -- it kept
 binding all the keys at once no matter what key I set. Because of this,
 hitting any key would trigger my alert "hello." It took two days to find
 what was wrong, but this code below should work for everyone, where 'S' is
 the key you chose to keydown (or up) upon:

 jQuery(document).bind('keydown', function (e){
         if (String.fromCharCode(e.keyCode) == 'S') {
 alert('hello');
 e.preventDefault();
 return false;
    }
 });


 Hope this is helpful to someone!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19489#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list