Bug Tracker

Ticket #2338: jquery-4750-which.diff

File jquery-4750-which.diff, 691 bytes (added by DarkRyder, 12 years ago)
  • event.js

     
    321321                }
    322322                       
    323323                // Add which for key events
    324                 if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
    325                         event.which = event.charCode || event.keyCode;
     324                if ( typeof event.which == "undefined" && (typeof event.charCode != "undefined" || typeof event.keyCode != "undefined") )
     325                        event.which = typeof event.charCode != "undefined" ? event.charCode : event.keyCode;
    326326               
    327327                // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
    328328                if ( !event.metaKey && event.ctrlKey )