Page 1 of 1

Hotkey Next Article Jump 4 at a time

Posted: 12 Mar 2016, 17:12
by blackdragon1
Hello everyone, first let me be clear this is NOT a bug it's a request.
I've made some custom CSS that lets me see 4 articles at a time in combined feed display.
When using Ctrl+Down I would like to go to the next "row" without having to press it 4 times.

Is there a way to make a plugin overriding the number of next articles?
Or do I need to mess with a JS file, and if so can someone direct me to it?
Or perhaps a third option which I fail to see.

If someone would like to use or try, here's the CSS, just slap it on Customize option and you're good to go.

Code: Select all

div.cdm {
   border: 5px solid gray;
   padding-right: 15px;
   vertical-align: top;
   display: inline-block;

div.cdmHeader > span.titleWrap {
   display: table-caption;

div.cdmHeader * {
   display: inline;

div.cdm.expanded {

div#floatingTitle {
   visibility: hidden !important;

Re: Hotkey Next Article Jump 4 at a time

Posted: 12 Mar 2016, 22:50
by fox
i think it should be possible to make this work using a plugin, you'll probably need to make a new hotkey action and set it to a keybind (i.e. HOOK_HOTKEY_MAP)

your plugin will need to include a JS file which defines the necessary function, i guess, maybe get the stock one and modify it to your liking or call it 4 times or something.

Re: Hotkey Next Article Jump 4 at a time

Posted: 13 Mar 2016, 20:40
by blackdragon1
It somewhat works, it jumps oddly not very 4 by 4 more like 6 then 3 at least visually. It serves its purpose, so I guess its fine.

Thanks for the help fox.

Here's the code.

Code: Select all

class Custom_Keys extends Plugin {

   private $host;

   function about() {
      return array(1.0,
         "Custom keys to skip 4 at a time",

   function init($host) {
      $this->host = $host;

      $host->add_hook($host::HOOK_HOTKEY_MAP, $this);

// KEYS can be:
//      "n"             = a single key character
//      "*n"            = Shift + key character  (Shift-n)
//      "^n"            = Ctrl + key character   (Ctrl-n)
//      "f q"           = a sequence of two keys
//      "(37)|left"     = a javascript key code and label
//      "^(38)|Ctrl-Up" = can use * Shift or ^ Ctrl with key codes
//  (search the web for "javascript key codes" for more examples)

   function hook_hotkey_map($hotkeys) {
      $hotkeys['(39)|right']   = '4xnext_article_noscroll';
      $hotkeys['(37)|left']    = '4xprev_article_noscroll';

      return $hotkeys;

   function get_js() {
      return file_get_contents(dirname(__FILE__) . "/customkeys.js");

   function api_version() {
      return 2;



Code: Select all

hotkey_actions['4xnext_article_noscroll'] = function() {
      for (i = 0; i < 4; i++) {
         moveToPost('next', true);

hotkey_actions['4xprev_article_noscroll'] = function() {
      for (i = 0; i < 4; i++) {
         moveToPost('prev', true);

Re: Hotkey Next Article Jump 4 at a time

Posted: 13 Mar 2016, 20:58
by fox
yeah you might run into problems trying to call it 4 times in a row really fast

its probably better to rewrite the function to mark 4 articles at once and/or use small timeouts or something, idk