Q:

Is there a way to capture/override Ctrl-R or F5 on IE using Javascript?

I want to capture the Ctrl-R or F5 shortcut on the browser to prevent it from performing a browser refresh, but instead perform a custom refresh. 
I was able to capture Ctrl-R on Safari and FF using:
document.onkeypress = function(e){
      if ((e.ctrlKey || e.metaKey) && e.keyCode == 114) // Ctrl-R
    e.preventDefault();
}

But that doesn't work on IE. Is there any way to do this on IE?
Update: For people who are asking why I am doing this in the first place: I just wanted to do a custom app refresh, but wanted to avoid having a "refresh" button because I kinda discourage using the refresh (We have a full page flex app). We ended up switching to F8 because F5 was just too hard to get working on all browsers.

A:

Open JavaScript
http://www.openjs.com/scripts/events/keyboard_shortcuts/
For certain keys (F1, F4), you have to open a new browser window without the address bar.
Example
Open a new window, without adornments:

window.open( 'webpage.html', 'TLA', 
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=665' );

JavaScript to use the library:
var FALSE_FUNCTION = new Function( "return false" );

/**
 * Called to disable F1, F3, and F5.
 */
function disableShortcuts() {
  // Disable online help (the F1 key).
  //
  document.onhelp = FALSE_FUNCTION;
  window.onhelp = FALSE_FUNCTION;

  // Disable the F1, F3 and F5 keys. Without this, browsers that have these
  // function keys assigned to a specific behaviour (i.e., opening a search
  // tab, or refreshing the page) will continue to execute that behaviour.
  //
  document.onkeydown = function disableKeys() {
    // Disable F1, F3 and F5 (112, 114 and 116, respectively).
    //
    if( typeof event != 'undefined' ) {
      if( (event.keyCode == 112) ||
          (event.keyCode == 114) ||
          (event.keyCode == 116) ) {
        event.keyCode = 0;
        return false;
      }
    }
  };

  // For good measure, assign F1, F3, and F5 to functions that do nothing.
  //
  shortcut.add( "f1", FALSE_FUNCTION );
  shortcut.add( "f3", FALSE_FUNCTION );
  shortcut.add( "f5", FALSE_FUNCTION );
}

Inside webpage.html:
<body onload="disableShortcuts();">

A:

There's no solid way to override the function-keys in browsers.
Internet Explorer has certain keys that can't be overridden, and certain keys which - even when overridden - still executes default behavior--like the F11 key, which switches to full-screen mode, and the F1 key which opens up a help-window.
Chrome does not allow you to use key-events at all.
FireFox is the most benign, but still sketchy--like Internet Explorer; there are still some keys and default behavior you cant override.
And finally.. Opera.. Which is about as difficult as Internet Explorer.
And the default behavior is different from version to version. It's like walking into a mine-field.. Blindfolded.. :)  
Trying to override CTRL+R / F5 smells like bad design. 
What problem are you trying to solve?

