This `evt.which` logic is borrowed from the way jQuery does the same sort of checking within their internals.