Register key press events
The CEP-9 github spot says the following:
Register an interest in specific key events
(Since 6.1) Register an interest in some key events to prevent them from being sent to the host application:
CSInterface.prototype.registerKeyEventsInterest = function(keyEventsInterest) This function works with modeless extensions and panel extensions. Generally all the key events will be sent to the host application for these two extensions if the current focused element is not text input or dropdown.
If you want to intercept some key events and you want them to be handled in the extension, please call this function in advance to prevent them being sent to the host application.
- keyEventsInterest: A JSON string describing those key events you are interested in. A null object or an empty string will lead to removing the interest
This JSON string should be an array, each object has following keys:
- keyCode: [Required] represents an OS system dependent virtual key code identifying the unmodified value of the pressed key.
- ctrlKey: [optional] a Boolean that indicates if the control key was pressed (true) or not (false) when the event occurred.
- altKey: [optional] a Boolean that indicates if the alt key was pressed (true) or not (false) when the event occurred.
- shiftKey: [optional] a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred.
- metaKey: [optional] (macOS Only) a Boolean that indicates if the Meta key was pressed (true) or not (false) when the event occurred. On Macintosh keyboards, this is the command key. To detect Windows key on Windows, please use keyCode instead.
But here is what I get in Adobe Illustrator CC2019?
Uncaught TypeError: csInterface.registerKeyEventsInterest is not a function
How on earth could that be?
