January 12, 2021

I created a bookmarklet which enables pressing Shift to insert pencil marks on

Want to use the bookmarklet?


  • Make a new bookmark in your browser (right-click on the bookmarks bar and click Add Page...)
  • Set the "Name" to something like " keyboard shortcuts"
  • Paste the following codeblock into the "Location" of the bookmark


In the midst of the 2020 pandemic I was very entertained for a couple of weeks watching the cracking the cryptic youtube channel solve sudoku puzzles. The channel uses a couple of basic techniques to solve some pretty challenging problems, most notably Snyder notation.

The basis of Snyder notation is that you pencil mark a number in a cell when there are two possible locations for the number in the cell's block. (Check out this cracking the cryptic video for a visual explanation)

In the cracking the cryptic videos, the authors use a self made app to solve their puzzles. Part of the allure of watching the authors solve sudoku puzzles is the clear speed and expertise the authors have using their app. They are able to solve the sudoku puzzles at the speed of thought. It is very clear that they are using keyboard shortcuts.

Although the cracking the cryptic app is quite good it is only available for puzzles shared on the cracking the cryptic Youtube channel. Like a couple other people I found it pretty frustrating that there were so few apps which support keyboard shortcuts for pencil marks.


I built a bookmarklet for which clicks on the pencil mark button when you press the shift key. pencil mark button

The code is pretty straightforward and I've added an annotated version below.

// if the bookmarklet hasn't been run
if (window._sudoku_bookmarklet !== true) {
  // when user presses shift click the pencil mark
  document.addEventListener("keydown", (e) => {
    if (event.key === "Shift") {

  // when user release shift click the pencil mark
  document.addEventListener("keyup", (e) => {
    if (event.key === "Shift") {

// mark that the bookmarklet has been run
window._sudoku_bookmarklet = true;

What's the point

It's cool that the browser is relatively hackable by end users. I found an issue with an application on the internet and I aded a feature in just a couple of lines of code.

Unfortunately most of these solutions suffer from usability issues. For many people dragging a bookmarklet and clicking it is already too complex. Not because it is a complicated thing to do per se, but because it does not fit into their mental model of how browsers work. For people who do drag the bookmarklet into their menu bar it is easy to forget the bookmarklet exists, and clicking a bookmarklet for every feature you want to add to a website isn't really a nice experience.

Tools like tampermonkey and greasemonkey are interesting because they can run when a page loads but they are even more complicated than dragging a bookmarklet to the bookmark bar.

Want More?

If you really truly enjoy bookmarklets and keyboard shortcuts check out sudoku exchange which has a set of bookmarklets for importing puzzles from other apps and has a bunch of nice keyboard shortcuts.