Changelog for #1414 plus documentation tweak

This commit is contained in:
Ian Gilman 2018-03-07 09:28:20 -08:00
parent 6c7fcb1063
commit c915a5966f
2 changed files with 3 additions and 13 deletions

View File

@ -9,6 +9,7 @@ OPENSEADRAGON CHANGELOG
* The "page" event is now fired after the page index has been updated (#1330)
* Added option pixelsPerArrowPress that sets the speed of arrow keys (#1364)
* Improved IIIF options.maxLevel calculation (#1401)
* Added canvas-key events, along with the ability to cancel key actions (#1414)
2.3.1:

View File

@ -2483,6 +2483,7 @@ function onCanvasKeyDown( event ) {
preventVerticalPan: event.preventVerticalPan,
preventHorizontalPan: event.preventHorizontalPan
};
/**
* Raised when a keyboard key is pressed and the focus is on the {@link OpenSeadragon.Viewer#canvas} element.
*
@ -2548,20 +2549,8 @@ function onCanvasKeyPress( event ) {
preventVerticalPan: event.preventVerticalPan,
preventHorizontalPan: event.preventHorizontalPan
};
/**
* Raised when a keyboard key is pressed and the focus is on the {@link OpenSeadragon.Viewer#canvas} element.
*
* @event canvas-key
* @memberof OpenSeadragon.Viewer
* @type {object}
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.
* @property {Object} originalEvent - The original DOM event.
* @property {Boolean} preventDefaultAction - Set to true to prevent default keyboard behaviour. Default: false.
* @property {Boolean} preventVerticalPan - Set to true to prevent keyboard vertical panning. Default: false.
* @property {Boolean} preventHorizontalPan - Set to true to prevent keyboard horizontal panning. Default: false.
* @property {?Object} userData - Arbitrary subscriber-defined object.
*/
// This event is documented in onCanvasKeyDown
this.raiseEvent('canvas-key', canvasKeyPressEventArgs);
if ( !canvasKeyPressEventArgs.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {