I have a Mac Keyboard I am using with new version of Ubuntu. Whenever in a web browser, I try and hit the F5 key to naturally refresh the page but in Ubuntu this key seems to be mapped to Keyboard Brightness Down.

I verified this by running xev and hitting my F5 key and the keycode was mapped to XF86KeyboardBrightnessDown. I then went into another terminal and attempted to map it to a regular F5 with the command `xmodmap -e "keycode 237 = F5". The new problem is, when I hit F5 just once or multiple times, the default keyboard brightness behavior is still there, and F5 now only refreshes the page in a browser if I hold F5 down for a bit.

I assume holding it down expires the event triggering of F5 to the OS, however in a browser like chrome, when the key is held down the events are still firing, and it eventually refreshed the page. So I assume right when the OS stops listening for the key, the browser is still listening at a higher level and default browser functionality of F5 kicks in.

How can I totally eliminate the default behavior of the F5 key to the OS?? Is what I want to do possible?


Also if I map F5 functionality to another key that has no default behavior like my F13 Key (which is mapped to XF86Tools but doesn't do anything) it instantly refreshed the page in a browser, I just have this issue with this key that right on a press, tries to modify the keyboard brightness which doesn't exist.

  • xmodmap is, unfortuantely, deprecated. Not a duplicate at all, but maybe askubuntu.com/a/423245/16395 can help you.
    – Rmano
    Jun 21, 2015 at 18:35
  • Possible workaround: Press Ctrl+R instead of F5 (or maybe it's Cmd+R on a Mac keyboard)
    – wjandrea
    Jun 8, 2016 at 2:11

2 Answers 2


Take a look at xbindkeys.

Create at $HOME/.xbindkeysrc and make sure to launch xbindkeys on startup.


If you need to emulate another key press with the F5 key, look into xdotool. I unfortunately don't have much experience with that one.


This can be related to "FN" key being activated by default. If this is your case, try to press "FN" key and F5 or whatever key you need. If you don't care about advanced settings, you can check bios settings for settings related to "FN" key. reboot (or restart) your pc and press apropriate key, maybe "del(ete)" or "F2" by default. And try. And sorry for bad english.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.