Logitech / logi_craft_sdk

Provide (API) SDK specifications to map your app functions to Logitech Craft dial controller called "Crown".
575 stars 110 forks source link

Having Trouble Understand How to Make Custom Plugin for App #24

Open llpf1112 opened 5 years ago

llpf1112 commented 5 years ago

So, disclaimer, I'm totally new to coding. And I have trouble understanding the instruction here. Is there a more layman termed instructions that I can follow? So far, I used the C# and I was able to make it to step 4 without problem. But the rest is hard for me to understand.

I just wish to enhance/enable some contextual functions for certain app. Preferably I can customize some of the icons. If someone could tell me what does what, and which par of the code I need to change in a layman term would be helpful. Thanks!

ju2pom commented 5 years ago

Hi, I've been through the same questions a few months ago, that's why I have created an alternative SDK here: https://github.com/ju2pom/logicraftsdk.NET

llpf1112 commented 5 years ago

oh, thank you for your help. I will give it a try and let you know if it works for me. Thanks again!

llpf1112 commented 5 years ago

I'm sorry but this still seems too difficult for me to understand. But thanks for your help still.

naokihada commented 5 years ago

Hi @llpf1112

Following is steps to enhance overlay set.

1) Context report is by "tool_change" event. https://github.com/Logitech/logi_craft_sdk/blob/master/samples/WinFormsCrownSample/WinFormsCrownSample/Form2.cs Line #127 ex) Line #593: toolChange("TextBox");

2) tools.json file defines overlay set https://github.com/Logitech/logi_craft_sdk/blob/master/samples/WinFormsCrownSample/d510af8d-360f-4f3d-9216-20cd4f20f664/Manifest/tools.json ex) Line #44: "name": "TextBox", Same section, it has set of overlay and image files. ex) Line #50: "image_file_path": "height.png", If you add more set, it will enhance more overlay set.

3) Overlay images are in Gallery https://github.com/Logitech/logi_craft_sdk/tree/master/samples/WinFormsCrownSample/d510af8d-360f-4f3d-9216-20cd4f20f664/Gallery ex) height.png https://github.com/Logitech/logi_craft_sdk/blob/master/samples/WinFormsCrownSample/d510af8d-360f-4f3d-9216-20cd4f20f664/Gallery/height.png You can add more image files here.

4) UI strings https://github.com/Logitech/logi_craft_sdk/blob/master/samples/WinFormsCrownSample/d510af8d-360f-4f3d-9216-20cd4f20f664/Languages/en.json You can add entry here for tool_options.

5) Back to C# code to handle "crown_turn_event" https://github.com/Logitech/logi_craft_sdk/blob/master/samples/WinFormsCrownSample/WinFormsCrownSample/Form2.cs Line #212: case "TextBox": Please compare with 2)'s json file.

Note: JSON file is easy to get wrong file format in editing. It's nice to check with some JSON lint program or site with your favorite editor. Pretty JSON for Sublime Text3 https://packagecontrol.io/packages/Pretty%20JSON https://jsonlint.com/

Thank you, Naoki

llpf1112 commented 5 years ago

I see, I guess I understand it a little bit better. Thanks.
It'll take me some time to figure it all out. I might ask more questions in the future. Thank you all for your time.