Logitech K380 bluetooth keyboard - make function keys default

I created GitHub repository for k380 configuration program.

https://github.com/jergusg/k380-function-keys-conf

I did the same steps as Mario to get sequence for k380. The code is same as Mario's, but with the sequence for k380 keyboard and k380 device ID. It outputs write: 0 were written instead of 7 on my computer, but it works anyway.

The sequences are:

const char k380_seq_fkeys_on[]  = {0x10, 0xff, 0x0b, 0x1e, 0x00, 0x00, 0x00};
const char k380_seq_fkeys_off[] = {0x10, 0xff, 0x0b, 0x1e, 0x01, 0x00, 0x00};

Just an update, Logitech Options software can natively support the feature, Use F1 - F12 as standard function keys. See the picture below.

enter image description here


I have exactly the same problem and also found the article about K810, which is:

http://www.trial-n-error.de/posts/2012/12/31/logitech-k810-keyboard-configurator/

I have already tried something similar to what Mario did with K810, but I am yet to find the proper sequence that needs to be sent to K380. In fact, it's something I don't quite understand from the article. I have already sent Mario a message asking how he figured out the exact sequence, but I don't have any reply yet.

In case someone else tries to figure it out, this seems to be the keyboard ID, at least in my case:

#define HID_DEVICE_ID_K380      (__s16)0xb342

vendor ID seems to be the same:

#define HID_VENDOR_ID_LOGITECH  (__u32)0x046d

I like Jerguš's answer, but I don't want to compile c code.

Here is the equivalent one-line bash

echo -ne "\x10\xff\x0b\x1e\x00\x00\x00" | sudo tee /dev/[the device]

Even better, this can be automatized!

Create a file /etc/udev/rules.d/70-logi-k380.rules with the folloing line

ACTION=="add", SUBSYSTEM=="hidraw", KERNEL=="hidraw*", SUBSYSTEMS=="hid", KERNELS=="*:046D:B342.*", RUN+="/bin/bash -c \"echo -ne '\x10\xff\x0b\x1e\x00\x00\x00' > /dev/%k\""

Your keyboard will be fn-locked automatically.