2

I have a Thinkpad T460s with Kubuntu 20.04, and I use a Nacodex K680T keyboard that shares the number row with the function keys, F[1-12].

The function keys are selected by hitting a 'func' key in the bottom right of the keyboard.

Unfortunately I can't use the F[1-12] keys because every time I hit 'func' and a key in the number row, it engages laptop hotkeys: media keys, brightness, volume, etc.

Does anyone know how to turn off the hotkeys? I need my F[1-12] more than I need to control my brightness.

Update: I have more information - I've installed screenkey and I see that the func+num row is triggering XF86KbdBrightnessDown etc. Hopefully that information will be useful for someone who can tell me how to get rid of this problem.

I tried to create an ESXi boot USB from KVM and I couldn't hit F11 to get through the prompts, even inside the VM. So it's beyond refreshing a web page or entering Chrome dev tools with a single key at this point. This is creating a major usability issue for me.

I'm going to try checking the BIOS to see if the keys have been redirected, since the internal keyboard isn't registering F[1-12] either - so that leads me to believe it's a BIOS setting that got flipped somehow (don't remember doing it, but you never know...)

Oh, and I've tried combinations of [left/right] ctrl-func, alt-func, shift--func, shift-[alt/ctrl]-func - none of them do anything to help.

left ctrl-func locks the function keys on the K680T but they don't behave any differently (besides eliminating the number row without a func keypress).

  • don't know much about this keyboard, but it seems like you can change mode by pressing Fn + Left Ctrl together to switch between function and number mode.

    Sometimes you will need Fn + Alt + to access third-level functionality of keys. Again, I don't think this depends on the OS, but i'm not sure.

    – nucc1 Aug 04 '20 at 07:18
  • I suspect this is a UEFI option, not an Ubuntu option. Checking the hardware user guide for your machine on page 74 it explains how to toggle this behavior. To test without rebooting try pressing Fn + Esc, which should make the function keys the default (instead of the hardware functions). Does that fix it? – Tom Brossman Aug 04 '20 at 07:20

2 Answers2

3

I also have that same keyboard. Your script works well under X11, but not Wayland, so I spent some more time on this. It turns out that the keyboard reports to the system as an Apple keyboard, even in Windows mode. Run lsusb and you'll see Apple as the vendor.

echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode

The above command changes the behavior of the K680T's function keys to what you'd expect. This will, of course, also affect real Apple keyboards.

You can also add something to modprobe.d to handle this automatically on boot. Make a file called /etc/modprobe.d/50-hid_apple.conf with the following contents:

options hid_apple fnmode=0

Update your initramfs and you should be good to go.

0

The easiest solution I found for this after:

  • Scouring the web
  • Trying modifiers acpi_osi=, acpi_osi=Windows, and acpi_osi=Linux in GRUB_CMDLINE_LINUX_DEFAULT
  • Toggling the BIOS option enabled/disabled fn as primary function (which enabled in my BIOS means to treat as normal F[1-12] key, opposite of what a Lenovo support reference stated)
  • Trial and error with X11 xkb, hoping I could figure out which key the func key is (since it doesn't register in screenkey, but several XF86 keys did that weren't in /usr/share/X11/xkb/symbols/pc)

Was when I stumbled across this barebones xmodmap command script:

#!/bin/bash
# Script name: fix-fkeys.sh

fix the common F keys

xmodmap -verbose -e 'keycode 232 = F1' xmodmap -verbose -e 'keycode 233 = F2' xmodmap -verbose -e 'keycode 128 = F3' xmodmap -verbose -e 'keycode 212 = F4' xmodmap -verbose -e 'keycode 237 = F5' xmodmap -verbose -e 'keycode 238 = F6' xmodmap -verbose -e 'keycode 173 = F7' xmodmap -verbose -e 'keycode 172 = F8' xmodmap -verbose -e 'keycode 171 = F9' xmodmap -verbose -e 'keycode 121 = F10' xmodmap -verbose -e 'keycode 122 = F11' xmodmap -verbose -e 'keycode 123 = F12'

Reference: How to disable multimedia keys entirely? 18.04 LTS

The xmodmap keycodes don't correspond to any references I've found online, or codes listed in screenkey, xev or acpi_listen

But I noticed you can print out a current mapping with xmodmap -pk - so I used:

$ xmodmap -pk | grep Brightness

to find F1 and F2, since they were missing from the AskUbuntu answer referenced above, but were mapped to XF86BrightnessDown and XF86BrightnessUp respectively. So that pointed me in the direction of learning they were codes 232 and 233, and I filled in the last two keys.

That might be useful for configuration for someone else with a different keyboard whose keycodes don't match mine.

An xmodmap script is nice in the sense that it doesn't modify anything too confusing, system-reliant, or difficult to revert, all I have to do is invoke the script or set it to run on login.