DIY & Music & Guitar & Beer & Tech

Logitech K480 on Ubuntu and ‘fn buttons’ default behaviour

By default this keyboard (and as of my understanding similar keyboards from logitech) have ‘media buttons’ enabled by default i.e. f1-f12 will act as media buttons and function buttons are accessed by pressing fn buttons + f1-f12. For work this is really not acceptable. I made this fix for Logitech K480 based on work of Mario Scholz for K810. Source code is here:

K480 fix on github

What I did was to re-trace his step, in a virtual machine running win7 I installed SetPoint software from logitech and debugged the output to the bluetooth device. For K480 I got:

on (bingo!)
> to keyboard
ffff8801d2173000 2960870190 S Bo:2:013:2 -115 16 = 0c200c00 08004200 a210ff08 1c000000
< from keyboard
ffff8801ed13b000 1204929370 C Bi:2:013:2 0 29 = 0c201900 15004200 a111ff08 1b000100 00000000 00000000 00000000 00

off
> to keyboard
ffff88062b7db0c0 3001832891 S Bo:2:013:2 -115 16 = 0c200c00 08004200 a210ff08 1c010000
< from keyboard
ffff8801ed368b40 1227979618 C Bi:2:013:2 0 29 = 0c201900 15004200 a111ff08 1b010100 00000000 00000000 00000000 00

Note that messages to keyboard start with hex: ‘a2’ and from keyboard with ‘a1’ bytes. All in all, it works fine, I updated device ID as well to 0xb330 while K810 is 0x319. On a personal note, I like this keyboard, it has nice ‘drop’ for keys and spacing is just right – works really well for fast code writing :).

11 thoughts on “Logitech K480 on Ubuntu and ‘fn buttons’ default behaviour

  1. Awesome. Logitech should have provided a physical switch to do this. Note that you can use Logitech’s official utility for Windows to do this on Windows. For someone who didn’t know this yet (like me).

  2. Hi.

    I was trying to execute the config file but in the end of execution just output me
    write:0 were written instead of 7.
    Can you maybe help me about the issue?

  3. Hello, and thank for this greate contribution.
    Although the process is very easy, after I followed it, the console showed me the next lines
    The given device is not a supported Logitech keyboard: Operation not permitted
    Product : ffffb33d
    and after I modified the .c file a little, to match with the gave info, I got something like this
    Sending ON:
    write: 0 were written instead of 7.
    I hope you can help me, thanks

    1. when you see message like 0 are written it should be something with the device address related. I remember getting this a lot 🙂 play with the file until it can write to the device, list devices and try to match and change in the file(s).

    2. Hello I have also this things:
      The given device is not a supported Logitech keyboard: Operation not permitted
      Can you give me advice?
      Help!

  4. I have a K480 and I have a same problem too …
    Ubuntu 17.04 64-bit
    $ cat /sys/class/hidraw/hidraw2/device/uevent
    DRIVER=hid-generic
    HID_ID=0005:0000046D:0000B33D
    HID_NAME=Keyboard K480
    HID_PHYS=60:6c:66:74:eb:8f
    HID_UNIQ=34:88:5d:6b:b9:16
    MODALIAS=hid:b0005g0001v0000046Dp0000B33D
    $ sudo ./k480_conf -d /dev/hidraw2 -f on
    The given device is not a supported Logitech keyboard: Operation not permitted

  5. Yeah, I get this as well. Even if I modify the .c file to include the product id (0xb33d), trying to enable the standard F1-F12 keys does nothing. It does give me the error about 0 being written instead of 7, but with my old K480, this message could be ignored.

Leave a Reply to Gleb Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.