I'm used to the F5 key being the Refresh command (as it is in Windows OS for every browser I've ever used there) and not Command-R (which takes two fingers). On Mac OS X Lion, how can I assign the F5 key to be refresh inside Chrome?
You can change the shortcuts of menu items in System Preferences, but you can't assign multiple shortcuts to them.
You could also assign a shortcut to a script like this:
try tell application "Google Chrome" to reload tab 1 of window 1 end try
1) Go to Preferences > Keyboard > Keyboard Shortcuts.
2) Select "Application Shortcuts" from the left menu.
3) Click "+".
4) Fill out the form like so: Application Google Chrome, Menu Title:
Reload This Page, Keyboard Shortcut F5.
5) Click "Add".
F5 will refresh the page in Firefox but it's not currently enabled in Chrome for some reason. Using App Shortcuts in Keyboard preferences will get F5 to work, but it disables Command-R as a refresh shortcut. This wasn't a good solution for me so I removed the F5 shortcut definition. It had bugged me for months and I've finally solved it with Karabiner and help from the accepted answer:
<vkopenurldef> <name>KeyCode::VK_OPEN_URL_SHELL_chrome_refresh</name> <url type="shell">osascript -e 'tell application "Google Chrome" to reload active tab of window 1'</url> </vkopenurldef> <item> <name>Refresh Chrome Page With F5</name> <appendix>Enables the F5 key to refresh the page in Google Chrome.</appendix> <identifier>private.function_five</identifier> <only>GOOGLE_CHROME</only> <autogen>__KeyToKey__ KeyCode::F5, KeyCode::VK_OPEN_URL_SHELL_chrome_refresh</autogen> </item>
Open Karabiner's preferences, then on the Misc & Uninstall tab click the Open private.xml button. It'll open Finder and you can open the file from there in your favorite text editor. Enter the code above between the
<root> tags and save the file. Go back to the Karabiner preferences and switch to the Change Key tab and at the top right, click the Reload XML button. The new option should appear at the top and all you have to do is enable it.
<vkopenurldef>element defines an applescript command that can be bound to another key. This command tells Chrome to reload the active tab in window 1 (window 1 appears to be the active window).
<item>element binds the new command to a physical key - in this case F5.
Official instructions on the private.xml file can be found here: https://pqrs.org/osx/karabiner/document.html.en#privatexml
If your on OS X that has Notification Center such as El Capitan follow the answer of Crhistian and then go to Mission Control in Keyboard Shortcuts and disable the F5 shortcut for Show Notification Center (and assign an alternative if you wish). BTW, this will disable the CTRL + R shortcut.