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

Linux support #9

Open gillesdegottex opened 6 years ago

gillesdegottex commented 6 years ago

Any chance to have this SDK working under linux? Since it runs on OSX, it might not be too far fetched.

mgielda commented 6 years ago

:+1: even if you are not planning Linux support anytime soon, it would be good to at least indicate what the biggest blockers are, this could allow you to get some help from the community to implement this.

naokihada commented 6 years ago

This SDK is harness between target app and Logitech Options (driver software for Craft Keyboard and other devices). Currently Logitech Options is available only Mac and Win. So to have Linux support for this SDK, we need to have Linux version of Logitech Options first.

Logitech Options https://www.logitech.com/en-us/product/options

gillesdegottex commented 6 years ago

Actually the magic knob is working properly, sending play/pause on press and volume +/- on rotation. So the only true thing missing is a soft to contextualise these commands.

Two other things:

trinitronx commented 5 years ago

@gillesdegottex : You may already know about solaar, but it appears that it is able to at least interrogate some Logitech devices and display at least battery info. Not sure what else is different about the Logitech Craft keyboard and Logitech Options software yet, as I don't have either. Maybe it's worth a try to check solaar and whether it gives useful info about this device?

gillesdegottex commented 5 years ago

Thanks for the info @trinitronx, I had use solaar a bit. However, there is no support for the knob on the top left of the keyboard (which is the purpose of this SDK).

trinitronx commented 5 years ago

@gillesdegottex : Maybe this is in-progress for the future? I'm not finding anything yet online about this keyboard's device info. Looks like there is an open issue on the solaar repo: pwr/Solaar#439 However, I don't see a mention of "Logitech Craft" in that repo's descriptors.py file yet.

There are obviously many people in the FOSS community interested in this keyboard as google searches show. One helpful piece of info I found here , which is that: Fn + Escape works for the fn-swap feature. No need for Solaar or Logitech Options then for that. Seems a bit better than the K-series keyboards in that respect. The top "crown" knob seems not well supported yet other than through official Logitech Options software. Too bad they don't provide a Linux version, but if a Mac one exists it's probably not that difficult for them to compile & port over.

Maybe you could try a solaar show to see if it has any info at all. However, I wouldn't expect it to show all the battery info maybe just Unifying Receiver and maybe an unknown paired device. It could be added in the future I'm sure... I just don't know what exactly to add to solaar, as I just stumbled across the project this week after getting a K780.

If it's anything like the other Logitech keyboards, I'd expect it to use HID++ also, which luckily they have published docs for both HID++ 1.0 (InternetArchive Cached), and HID++ 2.0 (InternetArchive Cached). Since it's newer, it's probably 2.0?

As for the Logitech Options software, it seems a future version of solaar or similar could possibly implement the same plugin API and therefore enable custom actions for the knob in Linux applications. They have published some helpful plugin docs (InternetArchive Cached).

trinitronx commented 5 years ago

@gillesdegottex : After some digging into that HID++ spec, and fiddling with usbhid-dump command, I believe I've figured out a way you might go about discovering wpid for addition to Solaar:

For example, my K780 keyboard shows this Device Connection event:

001:017:002:STREAM             1541120865.764312
 10 01 41 04 61 5B 40

So in this example:

We can validate the wpid by looking for Wireless Solar Keyboard K780 in descriptors.py which shows: wpid='405B'. So, flipping the order so it's MSB + LSB in "big endian" form we have 405B.

If you can find your wpid and deduce what HID++ protocol version to set in descriptors.py, you might be able to get basic functionality out of the Logitech Craft in Solaar.

gillesdegottex commented 5 years ago

What's the meaning of r2,r3 ? It could be the state information of the keyboard ? It might carry info about the wheel rotation type or angle ?

trinitronx commented 5 years ago

I think r2 and r3 are just the wpid and are used for identifying what particular device is connected to the wireless receiver. It seems like the state information is probably set or requested in different types of HID++ messages. My guess is that things such as fn-swap are the read/write register command types (0x81 - GET_REGISTER_REQ, 0x81 - GET_REGISTER_RSP). The wheel rotation settings could also be these, or some other commands in the HID++ 2.0 spec.

trinitronx commented 5 years ago

@gillesdegottex : I was trying to say that if you found wpid for the Craft keyboard, then you might add a stanza like the following to descriptors.py (replace XXXX with your wpid found from usbhid-dump) and see if solaar show detects it and shows any more info. It probably won't get full functionality out of the wheel rotation and would need further development to implement Logitech Options plugin API, but it's a start for at least adding basic support to Solaar.

_D('Logitech Craft Keyboard', protocol=2.0, wpid='XXXX',
                settings=[
                            _FS.new_fn_swap()
                        ],
                )

If it doesn't work, you could try passing different options to _D() like protocol=4.5, or adding registers=(_R.battery_status, ), for example if battery status wasn't detected. Look in that descriptors.py for more examples to try.

gillesdegottex commented 5 years ago

Great, thanks! I'll give it a try whenever I find some time.

alex20465 commented 4 years ago

Why doesn't just logi releases an python/c sdk service for linux ? 150 Eu keyboard and we don't even get supported.

xeor commented 4 years ago

bump

@logitech-people... We still got no support here :( Please give Linux some love as well! I've been looking for a good linux-keyboard for some days now, and you guys are not far from taking that marked if you do a little work here..

DreamWaterFound commented 4 years ago

Yes! Same request. Even a closed-source SDK is also OK ... :sob:

Please think about it, please! Few manufacturers have ACTUAL cross platform drivers (windows & Mac & Linux support with .deb and .rpm packages and other files) for keyboards and mice, logi should be and has the ability to be the representative.

Support for Linux may doesn't bring profit to the company, but for most Linux users, even just providing the low-level API, will make many users develop applications spontaneously. Even no consideration about how to implementation "Flow", no consideration about how to detect running applications is also OK, the open source community will help solve these problems.

I have bought a craft keyboard for one and a half years. Without Linux support the only function of crown is …… just adjusting the volume and play/pause, but it could have had more if we have official lower-level API. I thought that logi would add Linux support, but two years has pasted, nothing has changed. That let me sad.

Please give Linux some love as well ! :pray: :pray: :pray:

alpham commented 4 years ago

I've just received Logitech Craft wireless keyboard, I love everything in it but I hate the fact that I cannot customize the input dial!!

Any comment from @logitech-people?

arsobades commented 3 years ago

Any news on support?

AntouanK commented 3 years ago

Would be great to get some linux support. Thank you.

strohzwei commented 3 years ago

More how-to hints would be great. Thanks alot.

trinitronx commented 3 years ago

Support for Linux may doesn't bring profit to the company

:roll_eyes: That statement assumes that Linux users don't purchase hardware... a foolish assumption indeed!

DreamWaterFound commented 3 years ago

Support for Linux may doesn't bring profit to the company

That statement assumes that Linux users don't purchase hardware... a foolish assumption indeed!

The number of Linux users are far fewer than Windows and Mac. Linux users will really buy hardware, but those fees usually can not offset the cost of supporting Linux.

It's not something like assumption, it's a reality. Take a look at Windows UWP apps or Windows Phone apps, now very few companies still developing or maintaining apps for these platfrom. Few people use it, It's hard to get enough paid for what you give.

trinitronx commented 3 years ago

Support for Linux may doesn't bring profit to the company

That statement assumes that Linux users don't purchase hardware... a foolish assumption indeed!

The number of Linux users are far fewer than Windows and Mac. Linux users will really buy hardware, but those fees usually can not offset the cost of supporting Linux.

Simply based on platform market share alone... that assumption must also be questioned. It's a myth that's been propagated that Linux users are few when compared to Mac & Windows. That is only true when you limit your inquiry into classic "desktop" systems. The data actually shows that the number 1 platform by far is: Android!

Which is of course Linux. :penguin: Sure, it's not a classic "desktop" system... but it's Linux and that platform supports USB & Bluetooth keyboards. In fact, I've tested out a couple Logitech keyboards with some Android tablets. They work great!

As a Linux user, I realize the importance of good hardware support. That's why I research each purchase and make sure it will work with Linux well. It's also why I have purchased multiple Logitech keyboards over the years: they work with Linux, Mac, and Windows.

pfps commented 3 years ago

Solaar version 1.0.5 has support for the crown. It's quite different from the support in Logitech Options, but does allow modifying the crown's behaviour based on the current X11 program. This only works in X11.

Hyperadministrator commented 2 years ago

Issue still up, having a fresh Craft keyboard on my table and really sad about not being able to configure the rotator-button :(

pfps commented 2 years ago

I have a Craft Keyboard and it is working fine under Solaar. If there are features that you want you could file an enhancement issue.