Skip to main content
Inspiring
June 14, 2023
Answered

Capturing key strokes with SDK c++ plugin

  • June 14, 2023
  • 2 replies
  • 567 views

Hi fellow developers,

 

is there a convient way of capturing keyboard strokes in an SDK c++ plugin?

 

I managed to capture wether a key is pressed in custom made plugin tools.

But I can not find how I capture single key strokes.

 

Thx in advance for any hint.

 

Gr,

 

Doubl3

This topic has been closed for replies.
Correct answer A. Patterson
quote

I don't see any obvious interface for that in the AI headers, but I'm sure there are platform-dependent ways to do it. I use CORE, which allows you to set up notifiers for when any particular key is pressed, or it can check the state of modier keys at any time. One thing to watch for is that it doesn't "steal" key presses from other parts of AI, rendering other keyboard shortcuts useless.


By @Rick E Johnson

 

100% on this. We still have issues where we somestimes steal focus from the main AI document window and CTRL+Z stops working.

2 replies

A. Patterson
Inspiring
June 14, 2023

The SDK has no functionality for this as far as I know. We have done it, but it requires you to use platform SDKs (Windows, OSX) to find the window whose keystrokes you want to capture (when it has focus). We use Qt in our plugin and that helps us, but it's still tricky.

Rick E Johnson
Inspiring
June 14, 2023

I don't see any obvious interface for that in the AI headers, but I'm sure there are platform-dependent ways to do it. I use CORE, which allows you to set up notifiers for when any particular key is pressed, or it can check the state of modier keys at any time. One thing to watch for is that it doesn't "steal" key presses from other parts of AI, rendering other keyboard shortcuts useless.

A. Patterson
A. PattersonCorrect answer
Inspiring
June 14, 2023
quote

I don't see any obvious interface for that in the AI headers, but I'm sure there are platform-dependent ways to do it. I use CORE, which allows you to set up notifiers for when any particular key is pressed, or it can check the state of modier keys at any time. One thing to watch for is that it doesn't "steal" key presses from other parts of AI, rendering other keyboard shortcuts useless.


By @Rick E Johnson

 

100% on this. We still have issues where we somestimes steal focus from the main AI document window and CTRL+Z stops working.