Topic: Use arrow keys to switch pages

Posted under Site Bug Reports & Feature Requests

Add the ability to “click the next button with the arrow keys” so we don’t have to actually have to click the next button

For the meantime, here’s a tampermonkey script that does the same thing until it’s added :)

// ==UserScript==
// @name         e621.net Arrow Keys
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://e621.net/posts/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=e621.net
// @grant        none
// ==/UserScript==

(function () {
  'use strict';
  console.log(
    '%cInjected into e621.net\nYou can now use your arrow keys to move scroll through posts',
    'color: blue'
  );
  const clickOn = (sel) => document.querySelector(sel).click();
  document.addEventListener('keydown', (e) => {
    let url = new URL(window.location.href.toLowerCase());
    const pool = url.searchParams.get('pool_id');
    if (e.key === 'ArrowRight') {
      if (pool) clickOn(`#nav-link-for-pool-${pool} > a.next`);
      else clickOn('#nav-links-top > div > ul > li > a.next');
    }
    if (e.key === 'ArrowLeft') {
      if (pool) clickOn(`#nav-link-for-pool-${pool} > a.prev`);
      else clickOn('#nav-links-top > div > ul > li > a.prev');
    }
  });
})();

Edit: now know that A and D now move the posts the same way

The keyboard shortcuts page seems to imply that the left/right arrow should work too - perhaps a bug?

edit: I just noticed that actually that's for the posts listing, not for individual posts. It would make sense for consistency, I wonder if there's a reason not to?

Updated

faucet said:
The keyboard shortcuts page seems to imply that the left/right arrow should work too - perhaps a bug?

edit: I just noticed that actually that's for the posts listing, not for individual posts. It would make sense for consistency, I wonder if there's a reason not to?

If it's for "oops, I pressed arrows thinking I was in comments or whatever," why not numpad arrows?
...Not that that is what it is...

  • 1