mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Merge pull request #2270 from hrghauri/issue-2192
issues/2192 fix - Introduced canvas-key-press for keypress.
This commit is contained in:
commit
3d9ae49948
@ -2808,8 +2808,20 @@ function onCanvasKeyPress( event ) {
|
|||||||
preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal
|
preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal
|
||||||
};
|
};
|
||||||
|
|
||||||
// This event is documented in onCanvasKeyDown
|
/**
|
||||||
this.raiseEvent('canvas-key', canvasKeyPressEventArgs);
|
* Raised when a keyboard key is pressed and the focus is on the {@link OpenSeadragon.Viewer#canvas} element.
|
||||||
|
*
|
||||||
|
* @event canvas-key-press
|
||||||
|
* @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.raiseEvent('canvas-key-press', canvasKeyPressEventArgs);
|
||||||
|
|
||||||
if ( !canvasKeyPressEventArgs.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {
|
if ( !canvasKeyPressEventArgs.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {
|
||||||
switch( event.keyCode ){
|
switch( event.keyCode ){
|
||||||
|
Loading…
Reference in New Issue
Block a user