Enable Fn-Brightness Buttons Ubuntu

7

1

I am trying to get the Fn+F5 and Fn+F6 buttons to work on my ASUS UX305F laptop running Ubuntu 14.04. I have tried adding all of the following to /etc/default/grub without success:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

I have even tried mixing and matching some of them. Each time I ran sudo update-grub and restarted my computer only to be disappointed yet again. I also found that running acpi_listen produced no output when I pressed the keys leading me to believe that they are not captured. How can I fix this issue?

EDIT:

acpi_listen pressing F5:

^[[15~

acpi_listen pressing Fn+F5:

No output

xev pressing F5:

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0x9b, subw 0x0, time 41144271, (1,436), root:(783,488),
    state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5000001,
    root 0x9b, subw 0x0, time 41144399, (1,436), root:(783,488),
    state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xev pressing Fn+F5:

No output

EDIT 2:

Bug filed here for reference: https://bugs.launchpad.net/bugs/1458351

carloabelli

Posted 2015-05-24T04:20:48.180

Reputation: 444

1What do you mean by Fn+5 key? Do you mean you are pressing Fn key (which is alongside the Alt or Ctrl key) and the 5 numeric key? It will not send any special signal to your system. It will only send 5 to your system. Fn keys are hardware encoded. They don't work this way. – shivams – 2015-05-26T05:07:24.023

@shivams: You might post your comment as an answer. This is not the first time that the question of mapping Fn has come up, and it's always the same answer. – harrymc – 2015-05-26T06:07:52.080

@harrymc Wonder why he has awarded a bounty for that. Anyways, I'll post an answer. – shivams – 2015-05-26T06:39:44.783

@shivams Please see edit – carloabelli – 2015-05-26T11:10:28.580

@cabellicar123 Okay i got that. – shivams – 2015-05-26T13:19:12.393

@cabellicar123 Open "Keyboard Shortcuts" in your Ubuntu and try assigning Fn+F5 to some action in that list. See if you are able to assign there. – shivams – 2015-05-26T19:18:22.883

@shivams Tried it didn't recognize key press – carloabelli – 2015-05-26T19:27:42.620

@cabellicar123 Try using xev command also. – shivams – 2015-05-26T19:38:45.013

@cabellicar123 Also, using the xev command or acpi_listen tell me when you press F5 and Fn+F5, does it report detecting different codes or the same code. Moreover, when you press Fn+F5, does it even report anything in xev? – shivams – 2015-05-26T19:39:30.257

@shivams Please see edit. Both acpi_listen and xev do record things for Fn + other function keys – carloabelli – 2015-05-26T22:16:56.717

@cabellicar123 As per the output, it is clear that kernel is detecting it as different from F5. That is good. But why it is giving no output is strange. Anyways, did you try this : GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" – shivams – 2015-05-27T04:39:17.997

@shivams That was the default it came with – carloabelli – 2015-05-27T15:07:48.660

@shivams In case you are still interested I submitted an official bug testing with the latest kernel here: https://bugs.launchpad.net/bugs/1458351

– carloabelli – 2015-06-01T14:32:29.443

@cabellicar123 Oh. That's great. Let's see how they follow up on the bug report. By the way, we never asked your Asus laptop model number. Could you tell that (and include it in your question)? The problem so far appears to be related to your specific model. – shivams – 2015-06-01T15:41:58.383

I have the same problem. Did you find something? – Glats – 2017-04-20T02:14:14.347

Answers

6

This is not how Fn keys work. If you press Fn+5, it is not going to send any special signal to the system. It is only going to send 5 as the keystroke.

The thing to understand here is that Fn keys are hardcoded in your laptop keyboard. So, if you press Fn key with, let's say F5 key, and if F5 key has a small icon below it marked as mute, then it is going to send a special signal (which will mute your speakers, if everything is properly set).

If you combine your Fn key with any other key on the keyboard which have no special markings for Fn key, it is not going to send any special signal.

shivams

Posted 2015-05-24T04:20:48.180

Reputation: 1 269

Fn+F10 (mute), Fn+F11 (vol down), Fn+F12 (vol up) all function correctly and have recorded signals in acpi_listen along with other function keys – carloabelli – 2015-05-26T11:06:49.843

In addition the F6 key and F7 key both have little icons and worked correctly with the Fn key when running windows – carloabelli – 2015-05-26T11:14:34.580

@cabellicar123: For most laptops, Fn+F10 etc. get translated by the keyboard firmware into a virtual-key code. You cannot map Fn, but you can map these virtual-key codes. Unfortunately, only some Fn combinations are handled by the keyboard firmware, and for the rest the result is undefined and most probably not what you are looking for. – harrymc – 2015-05-26T14:29:24.187

@harrymc My question is why the keys worked then for windows. Wouldn't that indicate the keys were being mapped and that somehow Ubuntu isn't recognizing these codes? – carloabelli – 2015-05-26T14:39:28.753

You might add more information about what works on Windows that doesn't on Ubuntu. It might however be that Windows is relying less on the keyboard firmware than Ubuntu and so is using lower-level keyboard functions. – harrymc – 2015-05-26T14:43:33.877

@harrymc All I really know is that brightness adjustments worked on windows when I was using it but having replaced it with Ubuntu they no longer work but other function keys do work – carloabelli – 2015-05-26T15:55:06.937

2

Can you set your brightness without using keyboard shortcuts? If yes it's not a grub or acpi issue.

You actually need to set keybindings to brightness functions, common media keybindings are included by default, but in your case your brightness keybindings are not. Configure them by using Dconf Editor.

https://wiki.ubuntu.com/Keybindings

Mustafa Can

Posted 2015-05-24T04:20:48.180

Reputation: 191

I can set brightness in system settings but shouldn't acpi log the events? – carloabelli – 2015-05-26T16:19:49.997

@cabellicar123: After Windows boots, the BIOS/UEFI is almost totally unused. Maybe that's the difference with Ubuntu. – harrymc – 2015-05-26T19:16:19.813