(function($){
  var SELECTED_FILE_ELEM = null;
  var ENABLE_KEY_NAV = true;

  $(document).keydown(function(event) {
    if (!ENABLE_KEY_NAV)
      return true;
    var selection = SELECTED_FILE_ELEM;
    switch (event.keyCode) {
      case 74: // j
        if (selection == null) {
          selection = $('#f0');
        } else {
          do {
            selection = selection.next();
          } while (selection.length > 0 && selection.css('display') == 'none');
        }
        break;
      case 75: // k
        if (selection == null) {
          selection = $('#f0');
        } else {
          do {
            selection = selection.prev();
          } while (selection.length > 0 && selection.css('display') == 'none');
        }
        break;
      case 13: // Enter
      case 79: // o
        if (selection != null) {
          var expander = selection.find('.expander');
          if (expander.length > 0) {
            expander.click();
          } else {
            var href = selection.find('a.file').attr('href');
            if (!href)
              href = selection.find('a.parent').attr('href');
            if (href)
              window.location = href;
          }
        }
        return false;
        break;
      default:
        return true;
    }
    if (selection.length > 0) {
      if (SELECTED_FILE_ELEM != null)
        SELECTED_FILE_ELEM.removeClass('focus');
      selection.addClass('focus');
      SELECTED_FILE_ELEM = selection;
    }
    return false;
  });

  $(function() {
    $('a,input,select,textarea,button')
      .focus(function(event) {
        ENABLE_KEY_NAV = false;
      })
      .blur(function(event) {
        ENABLE_KEY_NAV = true;
      });
  });
})(jQuery);

@@ -242,17 +242,29 @@
 74: // j
+ - next line
 %0A
-
         
@@ -312,32 +312,119 @@
 ion = $('#f0');%0A
+          if ( !selection.length ) %0A            selection = $($(%22#dirlist tr%22).get(1))%0A
         %7D else %7B
@@ -605,16 +605,32 @@
 75: // k
+ - previous line
 %0A       
@@ -890,16 +890,45 @@
 / Enter%0A
+      case 65: // 'a'nnotate%0A
       ca
@@ -937,17 +937,22 @@
  79: // 
-o
+'o'pen
 %0A       
@@ -1281,24 +1281,108 @@
    if (href)
+ %7B%0A              if (event.keyCode == 65)%0A                href += '?annotate=blame';
 %0A           
@@ -1408,16 +1408,30 @@
 = href;%0A
+            %7D%0A
         
@@ -1436,32 +1436,32 @@
     %7D%0A        %7D%0A
-
         return f
@@ -1477,24 +1477,224 @@
      break;%0A
+      case 76: // 'l'og%0A        if (selection != null) %7B%0A          var href = selection.find('td.rev a').attr('href');%0A          if (href)%0A            window.location = href;%0A        %7D%0A        break;%0A
       defaul

add two more key bindings: - 'a' for going to the annotate page - 'l' for going to the (change) log