getEventLocation = function getEventLocation(e) {

        // Use standard location, if possible
        if ('location' in e)
            return e.location;

        // Failing that, attempt to use deprecated keyLocation
        if ('keyLocation' in e)
            return e.keyLocation;

        // If no location is available, assume left side
        return 0;

    }
Returns the keyboard location of the key associated with the given
keyboard event. The location differentiates key events which otherwise
have the same keycode, such as left shift vs. right shift.

@private
@param {KeyboardEvent} e
    A JavaScript keyboard event, as received through the DOM via a
    "keydown", "keyup", or "keypress" handler.

@returns {Number}
    The location of the key event on the keyboard, as defined at:
    http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent