Skip to content

Instantly share code, notes, and snippets.

@anna-oake
Last active July 1, 2025 08:51
Show Gist options
  • Select an option

  • Save anna-oake/01ecfcc83732dfd9dda360e59d1999d4 to your computer and use it in GitHub Desktop.

Select an option

Save anna-oake/01ecfcc83732dfd9dda360e59d1999d4 to your computer and use it in GitHub Desktop.
Sudokumood Hotkeys
// ==UserScript==
// @name Sudokumood Hotkeys
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add hotkeys to sudokumood.com
// @author Anna Oake
// @match *://*.sudokumood.com/*
// @grant none
// ==/UserScript==
(function () {
"use strict";
const hotkeys = {
0: "#timer", // just something to remove focus from the board
"-": "#pauseButton",
"=": "#undo",
};
const elements = Object.fromEntries(
Object.entries(hotkeys).map(([k, v]) => [k, document.querySelector(v)]),
);
window.addEventListener(
"keydown",
(e) => {
elements[e.key]?.click();
},
true,
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment