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

In app option to add additional wheel tap configuration to assign existing functions #50

Open markusd1984 opened 2 years ago

markusd1984 commented 2 years ago

I would like to have more than one function assigned to the turning of the wheel, ideally even with ratchet mode. It seems a waste to only be able to change the function and only have one assigned to it, when it can support multiple ones that can be cycled through by tapping the wheel. This alone for existing function should not require a plugin to be created for, rather it should be provided by Logitech out of the box so the existing function can be utilised and ideally differentiate between a regular tap category or ratchet mode.

Shouldn't be too hard to have an interface to select adding an additional function, choose one of the functions that is supported by the main one, choose an icon that gets used for when taping the wheel.

(unfortunately the press and turn's function is limited to what is set under All applications, thus can be configured specifically to an app, which is also bit of a waste)

image

Craft-SDK_Intro-Crown-Interactions

HyperMadSan commented 2 years ago

I had a similar problem where I wanted to map multiple hotkeys of my IDE (SAP ABAP editor) to the crown. My solution was to create a generic plugin that allows you to define tools/tooloptions and assign hotkeys to those tools/tooloptions using a JSON file. The plugin program runs in the background and launches virtual key stroke(s) when the user turns/releases the crown, depending on the menu context. By naming the plugin executable the same as the target program the plugin is also activated when the target program gets focus. This way it is possible to create plugins for multiple programs, each with its own set of crown tools/tooloptions mapped to hotkeys.

image

markusd1984 commented 2 years ago

I had a similar problem where I wanted to map multiple hotkeys of my IDE (SAP ABAP editor) to the crown. My solution was to create a generic plugin that allows you to define tools/tooloptions and assign hotkeys to those tools/tooloptions using a JSON file. The plugin program runs in the background and launches virtual key stroke(s) when the user turns/releases the crown, depending on the menu context. By naming the plugin executable the same as the target program the plugin is also activated when the target program gets focus. This way it is possible to create plugins for multiple programs, each with its own set of crown tools/tooloptions mapped to hotkeys.

image

Thanks for sharing, interesting. The screenshot is that the also example of the plugin or just to demo the custom overlay menu?

Can you share the plugin example please?

HyperMadSan commented 2 years ago

Thanks for sharing, interesting. The screenshot is that the also example of the plugin or just to demo the custom overlay menu?

Can you share the plugin example please?

That screenshot is from the actual plugin being used in the target program (wfica32.exe). You can find the plugin code (Visual Studio project) here: https://github.com/HyperMadSan/Craft.git. There is no documentation as this plugin was intended for personal use only.

What you need to do is create a subfolder in folder resources. That subfolder must have the same name as your target program and contains the guid.json file and guid folder but also a tooloptions.json file. It's this tooloptions.json file that has the virtual key mapping. You can assign a hotkey (combination of keys e.g. ctrl+s), actual keystrokes or both. For instance, in SAP I can open a new window using ctrl+N and then type a transaction name and press enter. This can be mapped to a single tool option. A tool option can have single option or multiple options. With a single tool option, the virtual key(s) are pressed when the crown is turned. With multiple tool options you cycle through the options by turning the crown and the virtual keys are pressed when you release the crown. Please see the wfica32 folder for a working example. Do not use the saplogon folder as this contains obsolete data and will not work.

After building the solution you must copy the guid folder to LogiOptionsPlugins and install the profile in Logitech Options (as described in SDK). You can then start your executable and it will run in background (you will see it in task manager). If you named your executable the same as the target program, the plugin will become active when you use the target program.

Let me know if you need additional info/help.