{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/jquery/issues/2337","labels_url":"https://api.github.com/repos/jquery/jquery/issues/2337/labels{/name}","comments_url":"https://api.github.com/repos/jquery/jquery/issues/2337/comments","events_url":"https://api.github.com/repos/jquery/jquery/issues/2337/events","html_url":"https://github.com/jquery/jquery/issues/2337","id":78630133,"number":2337,"title":"Deprecate `which` property of the event object","user":{"login":"markelog","id":945528,"avatar_url":"https://avatars.githubusercontent.com/u/945528?v=3","gravatar_id":"","url":"https://api.github.com/users/markelog","html_url":"https://github.com/markelog","followers_url":"https://api.github.com/users/markelog/followers","following_url":"https://api.github.com/users/markelog/following{/other_user}","gists_url":"https://api.github.com/users/markelog/gists{/gist_id}","starred_url":"https://api.github.com/users/markelog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markelog/subscriptions","organizations_url":"https://api.github.com/users/markelog/orgs","repos_url":"https://api.github.com/users/markelog/repos","events_url":"https://api.github.com/users/markelog/events{/privacy}","received_events_url":"https://api.github.com/users/markelog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jquery/jquery/labels/Event","name":"Event","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-20T18:09:30Z","updated_at":"2015-05-20T19:21:46Z","closed_at":null,"body":"In the https://api.jquery.com/category/events/event-object/, we have \r\n\r\n> The following properties are also copied to the event object, though some of their values may be undefined depending on the event:\r\n\r\n> altKey, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, view, which\r\n\r\n`which` property is deprecated by the DOM specification - https://w3c.github.io/uievents/#widl-KeyboardEvent-which, it seems we need to add a note about it (and possible for the other properties too), deprecated it and show message in the migrate?\r\n\r\n/cc @dmethvin \r\n"},"comment":{"url":"https://api.github.com/repos/jquery/jquery/issues/comments/104004278","html_url":"https://github.com/jquery/jquery/issues/2337#issuecomment-104004278","issue_url":"https://api.github.com/repos/jquery/jquery/issues/2337","id":104004278,"user":{"login":"dmethvin","id":157858,"avatar_url":"https://avatars.githubusercontent.com/u/157858?v=3","gravatar_id":"","url":"https://api.github.com/users/dmethvin","html_url":"https://github.com/dmethvin","followers_url":"https://api.github.com/users/dmethvin/followers","following_url":"https://api.github.com/users/dmethvin/following{/other_user}","gists_url":"https://api.github.com/users/dmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmethvin/subscriptions","organizations_url":"https://api.github.com/users/dmethvin/orgs","repos_url":"https://api.github.com/users/dmethvin/repos","events_url":"https://api.github.com/users/dmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/dmethvin/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T19:21:46Z","updated_at":"2015-05-20T19:21:46Z","body":"Remember there is a `which` for both KeyboardEvent and MouseEvent. Both are pretty screwy.\r\n\r\nFor a keyboard event you're supposed to use `key` instead of `which` but for a long time the preferred property was `keyCode`. We copy both of them over to the normalized event if they are present, but neither will be there in IE8.\r\n\r\nThe W3C created [another confusing set](http://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent) of `button` and `buttons` properties for MouseEvent that also took a few years for browsers to get right. IE8 only supports `which` natively. At the time the other two properties were screwed up with other browsers we decided to normalize `which`. The docs say that we don't copy `buttons` but we do, so a lot of people may be using `button` and `buttons` already if they don't care about IE8.\r\n\r\nWe could deprecate `which` in 3.0 and have Migrate warn about the better choices here. The problem would be in the compat branch where IE8 needs it and we never normalized `button`, `buttons`, `keyCode`, and/or `key`. Also note that there may be a high perf penalty for that, we'll have to see. Events like mousemove or mouseover happen a lot."}}