Falcon BMS Forum
    • Register
    • Login
    • Search
    • Categories
    • Unread
    • Recent
    • Unsolved
    • Popular
    • Website
    • Wiki

    nodeBB keyboard navigation shortcuts

    General Discussion
    4
    10
    522
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hoover
      hoover last edited by hoover

      Hi folks,

      thanks to @MaxWaldorf the new forum comes with a plugin which allows easy “hands off the mouse” keyboard shortcuts for several forum functions.

      Please find below the list of keyboard shortcuts I’ve been able to find so far, and please feel free to add any others you may come across.

      Alt-t: open “tag” page
      Alt-p: open “popular” page
      Alt-g: open “groups” page
      Alt-o: open “options” (profile) page?
      Alt-s: open “users” page
      Alt-h: open “home” / “categories” page
      Alt-n: open “notifications” page

      “?”: open nodeBB keyboard plugin “Help” page
      j / k: move up / down in the list of topics / replies
      Alt-u: List of unread topics
      Alt-r: List of recently changed topics
      r: reload page
      t / b: go to top / bottom of page
      Alt-Enter: Reply to topic / post

      Ctrl-Enter: Send reply (use in post editor)

      Enter: enter / display topic

      Backspace: Up one level (back to topic list)
      Alt-c: Open chat screen

      If you would like to remap these shortcuts to other keys (or maybe you have been using my greasemonkey script on the old forum pages for easy keyboard navigation), then I have good news for you: A customized version of this script is also available for greasemonkey / tampermonkey on all half-way modern browsers which will bring back all the old keyboard mappings to the way they worked on the old forum.

      You can find the script here:

      https://greasyfork.org/en/scripts/433433-nodebb-remap-shortcuts

      I’ve also included the source code below (make sure to replace “hoover” with your username for the chat shortcut to work as described in the comment).

      // ==UserScript==
      // @name                nodeBB remap shortcuts
      // @namespace	        https://hoover.gplrank.de/
      // @description	        remaps various nodeBB keyboard shortcuts to simple keypresses
      // @description         author: hoover
      // @description         You'll need to replace "hoover" with your forum username for the "chat" link to work below.
      // @include             http*://forum.falcon-bms.com/*
      // 
      // @version 0.0.2.20211018140000
      // ==/UserScript==
       
      function findTopicLink()
      {
          var anchors = document.getElementsByTagName('a');
          var href="/unread";
          for (var i = 0  ; i < anchors.length ; i++) {
             href = anchors[i].getAttribute('href');
             if (href) {
                if(href.match(/topic/)) {
                    return(href);
                   break ;
       
                   }
                }
             }
      }
       
      var key_map = {
          "N" : "/unread",
          "R": "/recent",
          "P": "/popular",
          "H": "/",
          "C": "/user/hoover/chats",
          "S": "/search",
          "M": "/notifications",
          "G": findTopicLink()
          }
       
      // stolen shamelessly from userscript.org's facebook key navigation
      // Thanks to Droll Troll
       
      function OnKeyUp(e)
      {
        
       
          if (String.fromCharCode(e.keyCode) in key_map && 	
      	(typeof e.target.type == "undefined" || (e.target.type != "text" && e.target.type != "textarea")) && 
      	!e.altKey && !e.ctrlKey && e.keyCode <= 90)
          {
      	window.location.replace(key_map[String.fromCharCode(e.keyCode)])
          }
      }
       
       
      window.addEventListener("keyup",function(event) { OnKeyUp(event); },false)
      

      All the best & I hope you enjoy’ll enjoy easy, hands-off-the-mouse keyboard navigation from now on 🙂

      Uwe

      System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

      1 Reply Last reply Reply Quote 5
      • Pinned by  MaxWaldorf MaxWaldorf 
      • hoover
        hoover last edited by hoover

        I’d like to map the old “go to first unread post / thread” key (“g”) to work with nodeBB, but I’m afraid my JavaScript “skills” (basically copy & paste 😆 ) aren’t up to par for this. Can somebody point me in the right direction please?

        Basically this would entail sending the keystrokes “j” and “ENTER” in a sequence, “j” activating the first topic in the list and “ENTER” displaying it.

        Thanks in advance & all the best,

        Uwe

        System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

        1 Reply Last reply Reply Quote 0
        • hoover
          hoover last edited by

          o Added “?” which displays the keyboard plugins help page

          System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

          1 Reply Last reply Reply Quote 0
          • airtex2019
            airtex2019 last edited by

            Is there a help file / cheat-sheet for the markdown syntax?

            I just did backquotes out of habit and was pleasantly surprised to see it highlight text as “code”.

            hoover 1 Reply Last reply Reply Quote 0
            • hoover
              hoover @airtex2019 last edited by

              @airtex2019 I’m not aware of a cheatsheet per se, but there’s a plugin that will enable "proper " markdown to be used for composing posts:

              https://github.com/julianlam/nodebb-plugin-markdown

              All the best,

              Uwe

              System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

              airtex2019 1 Reply Last reply Reply Quote 1
              • hoover
                hoover last edited by hoover

                PS: According to this post, the nodebb-markdown package is part of the distribution, so it should work out of the box:

                https://community.nodebb.org/topic/11331/how-to-add-ability-for-users-to-markdown-and-add-code-to-their-posts

                The link above also contains another link to a proper markdown cheatsheet.

                All the best, Uwe

                https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

                System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

                1 Reply Last reply Reply Quote 1
                • airtex2019
                  airtex2019 @hoover last edited by airtex2019

                  @hoover Thanks … gee maybe it should occur to me that they probably have a good “forum” and I should go there to search…

                  tl/dr: sounds like it’s the Daring Fireball markdown standard

                  Or some strict subset of it? The help popup points here =>
                  https://commonmark.org/help/

                  1 Reply Last reply Reply Quote 0
                  • Locked by  MaxWaldorf MaxWaldorf 
                  • Unpinned by  MaxWaldorf MaxWaldorf 
                  • hoover
                    hoover last edited by

                    Hi folks,

                    here’s a little update to my keyboard nav script which now contains the “g” key as an additional feature (map it to your liking).

                    The “g” key will take you to the first “/topic”-Link on the page, so it’s not necessary to first hit “j” then followed by “ENTER” in order to view the first unread post.

                    All the best,

                    Uwe

                    Source code:

                    // ==UserScript==
                    // @name                nodeBB remap shortcuts
                    // @namespace	        https://hoover.gplrank.de/
                    // @description	        remaps various nodeBB keyboard shortcuts to simple keypresses
                    // @description         author: hoover
                    // @description         You'll need to replace "hoover" with your forum username for the "chat" link to work below.
                    // @include             http*://forum.falcon-bms.com/*
                    // 
                    // @version 0.0.1.20211005082836
                    // ==/UserScript==
                    
                    function findTopicLink()
                    {
                        var anchors = document.getElementsByTagName('a');
                        var href="/unread";
                        for (var i = 0  ; i < anchors.length ; i++) {
                           href = anchors[i].getAttribute('href');
                           if (href) {
                              if(href.match(/topic/)) {
                                  return(href);
                                 break ;
                    
                                 }
                              }
                           }
                    }
                    
                    var key_map = {
                        "N" : "/unread",
                        "R": "/recent",
                        "P": "/popular",
                        "H": "/",
                        "C": "/user/hoover/chats",
                        "S": "/search",
                        "M": "/notifications",
                        "G": findTopicLink()
                        }
                    
                    // stolen shamelessly from userscript.org's facebook key navigation
                    // Thanks to Droll Troll
                    
                    function OnKeyUp(e)
                    {
                      
                    
                        if (String.fromCharCode(e.keyCode) in key_map && 	
                    	(typeof e.target.type == "undefined" || (e.target.type != "text" && e.target.type != "textarea")) && 
                    	!e.altKey && !e.ctrlKey && e.keyCode <= 90)
                        {
                    	window.location.replace(key_map[String.fromCharCode(e.keyCode)])
                        }
                    }
                    
                    
                    window.addEventListener("keyup",function(event) { OnKeyUp(event); },false)
                    

                    You can install the script using tampermonkey or greasemonkey from this URL:

                    https://greasyfork.org/scripts/433433

                    Let me know if you find any issues, the script seems to be working well on my end.

                    System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

                    1 Reply Last reply Reply Quote 1
                    • Unlocked by  MaxWaldorf MaxWaldorf 
                    • Pinned by  MaxWaldorf MaxWaldorf 
                    • hoover
                      hoover last edited by

                      <p>Hi folks,<br /><br />I’ve updated the first post with a new version of the script that works with the new editor that @MaxWaldorf installed on the site a few days ago (the old version won’t work with this editor any longer).<br /><br />All the best, <br /><br />Uwe <br /></p>

                      System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

                      1 Reply Last reply Reply Quote 0
                      • hoover
                        hoover last edited by

                        I just updated the script to ignore any “temporary-fixes” URL that might appear on the top of the pages (like the one that’s stickied now for 4.36).

                        You can update your script version / install here:

                        https://greasyfork.org/en/scripts/439812-nodebb-remap-shortcuts-new-editor-version

                        Cheers, Uwe

                        System specs: win10pro / Linux Mint 20.x, 32GB RAM, nv 1070ti, 2x1 TB SSD, 1x4TB SATA; HOTAS Warthog (DX), TM MFDs, G25Shifter, T500RS wheel / pedals; CPU: AMD Ryzen 7 3700X 8-Core; MoBo: X570-A PRO (MS-7C37); Display: 43" LG nano 779pa (2560x1440), 19" Fujitsu-Siemens (1280x1024) used for DE.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        87
                        Online

                        9.9k
                        Users

                        19.4k
                        Topics

                        329.6k
                        Posts

                        Benchmark Sims - All rights reserved ©