Skip to content

Instantly share code, notes, and snippets.

@natyusha
Created January 13, 2026 00:58
Show Gist options
  • Select an option

  • Save natyusha/b51a8fb73cca841b55d454d2b49b2e04 to your computer and use it in GitHub Desktop.

Select an option

Save natyusha/b51a8fb73cca841b55d454d2b49b2e04 to your computer and use it in GitHub Desktop.
Use the mouse wheel to navigate between plan pages (down = next, up = previous)
// ==UserScript==
// @name RaidPlan.io - Mouse Wheel Navigation
// @namespace https://gist.github.com/natyusha
// @version 1.0.0
// @description Use the mouse wheel to navigate between plan pages (down = next, up = previous)
// @match https://raidplan.io/plan/*
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('wheel', function(e) {
const isNext = e.deltaY > 0;
const key = isNext ? 'ArrowRight' : 'ArrowLeft';
// Create keyboard event that mimics pressing left/right arrow
const event = new KeyboardEvent('keydown', {
key: key,
code: key,
keyCode: isNext ? 39 : 37,
which: isNext ? 39 : 37,
bubbles: true,
cancelable: true
});
// Dispatch on document
document.dispatchEvent(event);
// Optional: prevent the wheel from scrolling the whole page
// (uncomment only if the page itself scrolls annoyingly when using the wheel)
// e.preventDefault();
}, { passive: false });
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment