registerGlobalModifierKeys Method


Registers the global handler responsible for tracking the modifier keys status.


JavaScript Syntax
registerGlobalModifierKeys = function() 
TypeScript Syntax
static registerGlobalModifierKeys(): void; 


Parts of LEADTOOLS interactive controls such as the image viewer and annotations automation has support for modifying the interaction with the user based on the status of the ALT / CTRL / SHITF keyboard keys. For example, the default behavior when ImageViewerPanZoomInteractiveMode is active and the user clicks and drags on the viewer surface, the mode will pan the view accordingly. However, when the CTRL key is down (pressed), the mode will zoom the view in and out. Similarly, when using the annotations automation toolkit an object is selected by clicking with the mouse and all other objects will be de-selected. However, if the SHIFT key was down, the object is added to the list of currently selected objects.

The keyboard is a global object and the status of the keys must be performed through a global keydown handler on the HTML document object.

RegisterGlobalModifierKeys will increment an internal counter and if the value is 1, will create the handler and increment a counter.

DeregisterGlobalModifierKeys will decrement the internal counter and when it reaches 0, will remove the global handler.

ModifierKeys can be used to get a value representing the modifier keys that are currently down (pressed).

Each ImageViewer object will automatically call RegisterGlobalModifierKeys upon creation and DeregisterGlobalModifierKeys when it is disposed. Therefore, the global handler is registered when the first image viewer instance in the application is created and is removed when the last viewer is removed.


Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly