registerGlobalModifierKeys Method

Summary

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

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

Remarks

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 / SHIFT 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.

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly