Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How to change the tool that will be temporarily selected by pressing Ctrl key?

Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

I need to change the tool that will be temporarily selected by pressing Ctrl key.

The default setting is kSelectTool, and I want to kDirectSelectTool.
I have used the following code for this:
______________________________________________________________________________

AIAddToolData data;
data.title = ai::UnicodeString("Annotator Tool");
data.tooltip = ai::UnicodeString("Annotator Tool");
data.sameGroupAs = kNoTool;
data.sameToolsetAs = kNoTool;
data.normalIconResID = kAnnotatorToolIconResourceID;
data.darkIconResID = kAnnotatorToolIconResourceID;
data.iconType = ai::IconType::kSVG;

ai::int32 options = kToolWantsToTrackCursorOption | kToolWantsAlternateSelectionTool;
error = sAITool->GetToolNumberFromName(kAnnotatorTool, &data.sameGroupAs); 
if (error) return error;

error = sAITool->GetToolNumberFromName(kAnnotatorTool, &data.sameToolsetAs); 
if (error) return error;

if (!result) {
result = sAITool->AddTool(message->d.self, kAnnotatorTool, data, options, &fToolHandle);
}

 

error = sAITool->SetAlternateSelectionToolName(fToolHandle, kDirectSelectTool);

______________________________________________________________________________

If SetAlternateSelectionToolName writed before AddTool, error > 0.
So I write it after AddTool, and error = 0.
And I can get the name kDirectSelectTool by using 

char* name;

sAITool->GetAlternateSelectionToolName(fToolHandle, &name);
Anyway when I pressed Ctrl key, I still got Select Tool. Nothing changed.
Can anyone please suggest me that what should I do in this code?
Thanks in advance
Kuo 

 

TOPICS
SDK

Views

251
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Adobe Employee ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

Hello @kuo chunh36971252,

 

Thanks for reaching out. I would request you kindly try the developer console website (https://console.adobe.io/servicesandapis), select Illustrator from the product list, and you should be able to download the required documentation to learn more about the SDK.

 

Kindly update this thread if you need further assistance. We'd be happy to help.

 

Thanks,

Anubhav

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

LATEST

Hi Anubhav,
Thanks for your reply. I haven't solved this problem yet.
Could you please point out what is wrong with my code?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines