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
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
Copy link to clipboard
Copied
Hi Anubhav,
Thanks for your reply. I haven't solved this problem yet.
Could you please point out what is wrong with my code?