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

Develop plugin for app #5

Open xamo1998 opened 6 years ago

xamo1998 commented 6 years ago

Hi, what can I do if I want make a plugin for an application, for example android studio. I mean if I want to that when I open android studio craft has a profile for it. For example if inside Android studio I click on X element I have a menu for it. Just like photoshop but developing it myself for an application that hasnt a profile for the craft.

Thanks

naokihada commented 6 years ago

I think following 2 things need to be considered.

xamo1998 commented 6 years ago

Yeah but I dont know how to start because I want a certain application. If i create a folder with the gallery, manifest.. and inside the manifest I write that my app is: studio64.exe Craft will know that my app is android studio but how can I manage the events that happens in android studio? In the example we create a .py file with the instruction and then the .exe but with 3rd apps I don't know what to do. A mini Example will help me a lot, let's say that I want that when I open Paint and select the brush I can change the size with the crown. How would I do that?

Thanks!

naokihada commented 6 years ago

What language are you using for Android Studio plugin? Java? Following is most of Adobe products support for example Photoshop.

  1. Target app Photoshop.exe in manifest file
  2. Adobe CEP plugin (NodeJS base instance within Photoshop) https://github.com/Adobe-CEP This will communicate with LogiOption with WebSocket.
  3. ExtendScript (JSX) CEP plugin can call JSX and get return value (ref. CSInterface.evalScript()) JSX controls Photoshop Context aware (different set of overlay) can be event handler or polling, but these are based on SDK capability. I'd suggest to start without context aware (always show up same set of overlay). Context aware part can be added later. Thank you.
xamo1998 commented 6 years ago

Can I use java for the plugin? I mean, the whole idea is to make a plugin that somehow get the tool context and somehow tells logiOption with WebSocket? But what plugin do I need for Jetbrains enviroments? I create a plugin in LogiOptions and in the manifest put studio64.exe. Everything else keep same as the demo ones. Craft does recognize the plugin but it does nothing. When I touch the crown it only appear the volume overlay. How can I at least change the overlay?

Thanks

naokihada commented 6 years ago

I think you can use Java. There's 2 limitations.

  1. Need to be executable or target main executable app (studio64.exe)
  2. WebSocket. This is the only API for LogiOptions

Volume overlay is just OS global option. The app is not connected to LogiOptions.

To change overlay, I think at least following steps is required on WebSocket after manifest configuration done.

  1. Send "register" message
  2. Receive ""register_ack" message. It has session_id to use later
  3. Send "tool_change" with session_id.

Thank you

xamo1998 commented 6 years ago

But what have I to code on java the whole plugin? I dont understand the limitations... And how can I do the steps? If you could tell me the steps to do I will start making it but I dont know how to start. Do I have to create a Java project? How do I get the events that occurs in android studio and where do I recive it?

If you have an example of changing the overlay of a 3rd app I'll appreciate it very much.

Thanks and sorry for the spam but this is the only place where I can get my doubts solved.

naokihada commented 6 years ago

But what have I to code on java the whole plugin? I dont understand the limitations...

If you are not sure this part, it might be better to step back to check on simple application or sample code. Your idea of supporting Android Studio plugin is more likely need to develop within its plugin limitation and have to connect to LogiOptions protocol on WebSocket.

So the limitation would come from both Android Studio plugin SDK and LogiOptions SDK.

LogiOptions SDK part is providing only WebSocket protocol to communicate and manifest files.

And how can I do the steps? If you could tell me the steps to do I will start making it but I dont know how to start.

I'd suggest following steps.

  1. Play LogiOptions sample program and understand how it works especially for WebSocket part.
  2. Play Android Studio plugin samples and understand how it works.
  3. Identify the limitations and requirement to connect both.
    • communication protocol: WebSocket
    • LogiOptions: specify executable path, etc
    • Android Studio: unknown for me
  4. Develop Android Studio plugin that connect to LogiOptions

Do I have to create a Java project?

It's depend on Android Studio. I'm not familiar enough to comment.

How do I get the events that occurs in android studio and where do I recive it?

It's depend on Android Studio. I'm not familiar to enough to comment. Usually there's 2 way to do. One is by event handler and preferred. Second one is polling to monitor certain readable properties.

Thank you