logi_craft_sdk
logi_craft_sdk copied to clipboard
Linux support
Any chance to have this SDK working under linux? Since it runs on OSX, it might not be too far fetched.
:+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.
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
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:
Gnome or something else was grabbing the keystrokes. The knob sends standard XF86AudioPlay, XF86AudioRaiseVolume, XF86AudioLowerVolume. The issue is that it is the exact same codes as the special keys (on top right of the keyboard). Thus, distinguishing the two might need to go at a lower level. A simple temporary solution is to contextualize XF86AudioPlay, XF86AudioRaiseVolume, XF86AudioLowerVolume (and too bad for the special keys).xevdoesn't report different key strokes when using the knob. though it is the same for the special keys (on top right of the keyboard) play/pause and volume +/-. Isxevoutdated? Is there something else for analysing keystrokes?- There is a mechanism in the knob to switch between continuous rotation and step-by-step rotation. I can't wake up this mechanism in any manner under linux. That might be the only thing that needs some reverse engineering.
@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?
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).
@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).
@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:
- Ensure keyboard & receiver are plugged in
- Run
usbhid-dump(NOTE: This will deactivate your keyboard input for the timeout time set inusbhid-dumpcommand! Make sure you have another way (other keyboard, SSH) to connect to the Linux machine and issue commands. You may need to kill the PID ofusbhid-dumpcommand.sudo kill $(pidof usbhid-dump)orps auxww | grep usbhid-dump | grep -v grep | awk '{ print $2 }' | xargs sudo kill. See man page forusbhid-dumpfor details.) - Wait until you see the "Device Connection" event
- See HID++ 1.0 spec section:
3.2 0x41 - Device Connectionfor details on how I found the info below. - This event in hex has the format:
10 ix 41 r0 r1 r2 r3where:ix= Index of keyboard on the Unifying Receiver (yes, there can be multiple "client" devices per receiver)0x41= "Device Connection" eventr0=bits [0..2] Protocol type.0x04 = Unifyingbits [3..7] Reserved
r1= "Device Info" - The HID++ 1.0 spec has more details, but in summary:bit0..3 = Device Typebit4 = Software Present flagbit5 = Encryption Status-0 = Link not encrypted,1 = link encryptedbit6 = Link Status-0 = Link established (in range),1 = Link not established (out of range)
r2=Wireless PID LSB- This is one of them you are looking for. It's in "reverse" using little-endian notation forwpid.LSB = Least Significant Bitr3=Wireless PID MSB- This is one of them you are looking for. It's in "reverse" using little-endian notation forwpid.MSB = Most Significant Bit
- See HID++ 1.0 spec section:
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:
ix=01= first (and only) device connected to Unifying Receiver0x41= This is our "Device Connection" event that we are looking forr0=bits [0..2] Protocol type=0x04 = Unifying
r2=Wireless PID LSB=5Br3=Wireless PID MSB=40
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.
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 ?
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.
@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.
Great, thanks! I'll give it a try whenever I find some time.
Why doesn't just logi releases an python/c sdk service for linux ? 150 Eu keyboard and we don't even get supported.
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..
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:
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?
Any news on support?
Would be great to get some linux support. Thank you.
More how-to hints would be great. Thanks alot.
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!
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.
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.
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.
Issue still up, having a fresh Craft keyboard on my table and really sad about not being able to configure the rotator-button :(
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.