diff --git a/src/event.js b/src/event.js index 65b59523e..00bef8472 100644 --- a/src/event.js +++ b/src/event.js @@ -470,8 +470,8 @@ jQuery.event = { } // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { - event.which = event.charCode || event.keyCode; + if ( event.which == null && (event.charCode != null || event.charCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; } // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)