Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently bought a Logitech K520 keyboard & mouse. It's a nice keyboard, and, as usual these days, it has laptop-style Fn keys mapped as alternatives onto the F1-F12 keys. I don't really need these, but since I'm giving up my right-hand Super/Windows key for an otherwise useless Fn key, it'd be nice to get some use out of them.

The problem is: some of the keys, instead of sending special key codes, send key combinations. For example, Fn+F5 sends Alt+Tab, and Fn+F6 sends Win+D.

I don't see any way to distinguish between actual Alt+Tab and Fn-key generated Alt+Tab at the operating system level - is there some way to program the keyboard to send alternative key codes? It it involves Windows-only software, would the change be permanent, i.e. could I reconfigure the keyboard from a Windows virtual machine and then reap the benefits on Linux?

share|improve this question
    
As an aside, isn't it awesome how they replace two-button commands with... two-button commands? </sarcasm> – Ignacio Vazquez-Abrams Aug 25 '12 at 15:33
    
@IgnacioVazquez-Abrams There is a way to swap the function keys such that you only need to press one key. – Lekensteyn May 3 '13 at 10:09

If you want to hack a bit, it is possible to remap these Fn keys on Linux. In my article Logitech Unifying for Linux: Reverse Engineering and unpairing tool, I describe how to monitor USB traffic to reverse engineer Logitech Unifying devices.

Requirements for reverse engineering reassignment of Fn keys yourself:

  • Basic knowledge of Logitechs HID++ 1.0 protocol (and perhaps 2.0 too depending on your device). (available at https://lekensteyn.nl/files/logitech/)
  • The tool presented in my article, read-dev-usbmon, can be used for easier monitoring.
  • Ability to write to privileged devices (usually /dev/hidraw0), see my article for details.

When time permits, I will look into this. Until that, I can only give you pointers:

  • On my K800 keyboard (HID++ 1.0), enabling notification bit 1 on field 1 changes the information sent by the keyboard, presumably to allow for customization as described by you. From https://git.lekensteyn.nl/ltunify/tree/registers.txt#n80:

    00 rw ENABLED_NOTIFS, 10 02 00, 10 is Battery info, buy what is 02?
    After writing FF FF FF, reading the register shows 13 02 00
    .1 .. .. - If enabled, keys like Web and Mute are passed over the HID protocol
        with short message type=03. This presumably allows the user to customize
        key bindings.
    .2 .. .. - ?
    1. .. .. - battery status (documented) (see also below, register/type 07)
    .. .2 .. - backlight changes (pressing Fn+F[56])
    

When somebody implements this (maybe me), it will likely end up in the Solaar software. This feature is tracked on https://github.com/pwr/Solaar/issues/31

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .