Fossil

Check-in [af89065ec5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revamp key handling to work with modifiers.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-keyboard-navigation
Files: files | file ages | folders
SHA3-256: af89065ec5a84766ad15c7e7ea8bb8dfbb3808147ad6c39abbcb97a0ba521a75
User & Date: florian 2022-07-31 08:39:00.000
Context
2022-07-31
08:48
Remove an unnecessary !important CSS directive that prevents overriding by skins. (This is a leftover from my private patches, where the same technique is used to alpha-blend an additional SVG background color with the original background color.) ... (check-in: 72dc40da49 user: florian tags: timeline-keyboard-navigation)
08:39
Revamp key handling to work with modifiers. ... (check-in: af89065ec5 user: florian tags: timeline-keyboard-navigation)
08:20
Refactor a function for later reuse. ... (check-in: 2087ad109e user: florian tags: timeline-keyboard-navigation)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
892
893
894
895
896
897
898

899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
      kf.type = 'text';
      kf.style.display = 'none';
      kf.style.visibility = 'hidden';
      kf.id = 'timeline-kbfocus';
      document.body.appendChild(kf);
    }
    document.addEventListener('keydown',function(evt){

      var
        kNEXT = 78 /* N */,
        kPREV = 77 /* M */,
        kTMLN = 74 /* J */,
        kVIEW = 75 /* K */,
        kDONE = 76 /* L */;
      var key = evt.which || evt.keyCode;
      if( evt.target.tagName=='INPUT' ) return;
      if( evt.altKey || evt.ctrlKey || evt.shiftKey ) return;
      var dx = 0;
      if( key==kPREV ) dx++;
      else if( key==kNEXT ) dx--;
      else if( key!=kTMLN && key!=kVIEW && key!=kDONE ) return;
      var kf = document.getElementById('timeline-kbfocus');
      if( key==kDONE ){
        kf.value = '';







>






|
<
|







892
893
894
895
896
897
898
899
900
901
902
903
904
905
906

907
908
909
910
911
912
913
914
      kf.type = 'text';
      kf.style.display = 'none';
      kf.style.visibility = 'hidden';
      kf.id = 'timeline-kbfocus';
      document.body.appendChild(kf);
    }
    document.addEventListener('keydown',function(evt){
      if( evt.target.tagName=='INPUT' ) return;
      var
        kNEXT = 78 /* N */,
        kPREV = 77 /* M */,
        kTMLN = 74 /* J */,
        kVIEW = 75 /* K */,
        kDONE = 76 /* L */;
        var key = ( evt.which || evt.keyCode )

                    | evt.altKey<<15 | evt.ctrlKey<<14 | evt.shiftKey<<13;
      var dx = 0;
      if( key==kPREV ) dx++;
      else if( key==kNEXT ) dx--;
      else if( key!=kTMLN && key!=kVIEW && key!=kDONE ) return;
      var kf = document.getElementById('timeline-kbfocus');
      if( key==kDONE ){
        kf.value = '';