08-04-2023, 09:27 AM
(This post was last modified: 08-05-2023, 05:32 AM by Rick Johnson.)
What kinds of things can cause keydown monitors to become unresponsive? (I blame macOS)
I often add keydown monitors to my tools, and generally it's worked well to add them on the tool's mouseDown event, respond to the keydown's callback during a drag, then remove the keydown monitor on mouseUp so that keystrokes aren't stolen from other plugins or from AI itself.
--> callback changes a variable if the 5 key is pressed
I can verify that the monitors are added and removed when they should be, but sometimes all of them in all of my CORE plugins become unresponsive -- not just slow, but they stop responding altogether. Regular modifier keys, however, can still be detected directly through the tool with no problem. I don't know about Windows, but it's happening in all versions of AI in macOS Ventura, possibly more often in recent updates. It was never a problem in macOS Big Sur and earlier.
I don't see a counterpart to CORE's keydown monitors in the SDK, so'll ask here rather than on an Adobe forum.
I often add keydown monitors to my tools, and generally it's worked well to add them on the tool's mouseDown event, respond to the keydown's callback during a drag, then remove the keydown monitor on mouseUp so that keystrokes aren't stolen from other plugins or from AI itself.
Code:
this->key5pressID = this->__corePlug->dispatcher()->addKeyDownMonitor(hdi::core::Dispatcher::LD_5Key, HDI_CORE_CALLBACK(panel::Plugin, this, __key5downCB));
--> callback changes a variable if the 5 key is pressed
Code:
this->__corePlug->dispatcher()->removeKeyDownMonitor(this->key5pressID);
I can verify that the monitors are added and removed when they should be, but sometimes all of them in all of my CORE plugins become unresponsive -- not just slow, but they stop responding altogether. Regular modifier keys, however, can still be detected directly through the tool with no problem. I don't know about Windows, but it's happening in all versions of AI in macOS Ventura, possibly more often in recent updates. It was never a problem in macOS Big Sur and earlier.
I don't see a counterpart to CORE's keydown monitors in the SDK, so'll ask here rather than on an Adobe forum.