Skip to content
Permalink
Browse files

Tweak the logic for fixing event.which. Fixes #2338.

  • Loading branch information
jeresig committed Sep 28, 2010
1 parent 9190d4f commit e3c4e5789743eecb3cbe2b626f3a5f09c616ee4b
Showing with 2 additions and 2 deletions.
  1. +2 −2 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) ) {

This comment has been minimized.

Copy link
@jdalton

jdalton Sep 29, 2010

Member

umm this is goofy event.charCode != null || event.charCode != null

This comment has been minimized.

Copy link
@jeresig

jeresig Sep 29, 2010

Author Member

Derp, yep - will fix.

event.which = event.charCode != null ? event.charCode : event.keyCode;
}

// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)

0 comments on commit e3c4e57

Please sign in to comment.
You can’t perform that action at this time.