67

Why is the space bar doing a page down in some viewer apps, especially browsers and PDF readers?

For me this seems to be a bit counter-intuitive, and also this behaviour affects games and other interactive HTML5 apps, because if you map some action to the space bar it might also scroll down the page, which is not what you want. Also the arrow keys, page down button and the mouse scrollwheel are usually enough options to scroll down the page.

Are there any historical or usability reasons for this behaviour?

4
  • 21
    It's also a usability issue for non-full-screen videos. Space is frequently used to pause/play videos; I'm always scrolling down youtube thanks to this.
    – OJFord
    Feb 28, 2014 at 0:16
  • 3
    I did not even know that. Feb 28, 2014 at 7:16
  • Me neither ! - and I've been using a browser since Netscape Navigator 1.0. The spacebar is for adding spaces in my mental model of the world...
    – PhillipW
    Dec 2, 2014 at 9:16
  • None of all that gobbledegook above means anything. Every time I hit the spacebar in Notability, it takes me backwards to a list of my documents. No one at Apple Care or elsewhere knows how to solve the problem. So my answer here is just as good (or bad) as all those above, which also didn't help. I believe there is no solution for this.
    – Jay
    Aug 1, 2020 at 23:19

5 Answers 5

79

The historical reason is that that's what the spacebar does in more, the lowest common demoninator (and probably oldest) of text pagers. In more, it makes sense to map the largest key on the keyboard to the most common action: show the next page.

In the glory days of more, you couldn't count on mouse scrollwheels, page down buttons, or sometimes even arrow keys. more doesn't even have a "page up" feature (you can't go back).

Although in the text-based world more has mostly been replaced with more powerful pagers like less (which can move backward), that spacebar convention remains, and has even migrated to the GUI world.

12
  • 8
    Do you guess the historical reason or do you know it? Could you provide some evidence?
    – phresnel
    Feb 28, 2014 at 9:34
  • 11
    "Press space to continue" was a very common way to move through an app in the pre-GUI home computing days of the 1980s, probably because it was the biggest button. Some apps implemented "Press any key to continue". This was slightly risky, as it didn't really mean "any" key, pressing escape or break would probably exit the programme, and it's alleged that some people couldn't find the "any" key.
    – rjmunro
    Feb 28, 2014 at 11:46
  • 8
    @phresnel The request for evidence is not unreasonable, but do remember that some of us are old enough that our programming days predate the PC and we've lived this 'spacebar for page down' time. There are probably many things not being written down (to be evidence later) because they're so obvious. For me, Celada's answer is that obvious. :) Feb 28, 2014 at 13:57
  • 5
    @phresnel I think the hard evidence you are looking for simply doesn't exist. This behavior of the space bar organically took root over time and eventually became tradition. It's often hard to pinpoint a specific decision; the best you might be able to do is ask Daniel Halbert, author of more why he chose the spacebar, and even that relies on the presumption that more drove that choice. Sometimes the best we can do is theorize and present evidence that supports our theories.
    – Jason C
    Feb 28, 2014 at 20:57
  • 3
    @phresnel (continued) ... This sort of thing comes up a lot in UI/UX design. Why is the minimize button on the top right? Why do pixel-based Windows dialogs use a 6 pixel button spacing and 12 pixel borders (and similarly, why are DLUs based on 8-point MS Sans Serif)? Why is does Ctrl+V mean paste (it was chosen by Xerox Parc back in Alto days but good luck finding a rationale)? At some point, somebody made a decision, possibly for completely arbitrary reasons, and it stuck.
    – Jason C
    Feb 28, 2014 at 21:01
30

The spacebar is the largest key of your keyboard, and is consequently the easiest one to interact with. For that reason, apps tend to use the spacebar for:

  • a simple action: where no input, precision or direction is involved.
  • a repeated action: the spacebar is the easiest to press several times in a row.
  • a "forgivable" action: if you accidentally press it, it's easily undoable.

For example, a media player's primary action is to toggle Play and Pause. It's simple (a yes/no toggle), it's repeated (with intervals), and it's forgivable (it's a toggle after all).

A browser primary action is to scroll because the web is still about reading content. It's simple (just go down), it's repeated (you scroll step by step), and it's forgivable (you can use your mouse or your arrows or even shift+space to go back).

11
  • An alternate take is: in GUIs, a button click could be executed using the Spacebar (provided the button was the active item), and since play/record/pause in Windows 3's sndrec.exe/mplayer.exe (or even earlier) were, well, buttons, it became customary for users to hit the spacebar. I can't remember having used the spacebar as play/pause keys in DOS applications like Autodesk Animator..
    – jørgensen
    Feb 27, 2014 at 22:18
  • @jørgensen in AA didn't space show/hide the toolbar?
    – SztupY
    Feb 27, 2014 at 22:27
  • 12
    I had never thought of shift+space.
    – John
    Feb 28, 2014 at 1:59
  • 1
    Another plus of the spacebar here is it's the closest key to you; if you are, say, sitting back in your chair to read a long document, the large size and close proximity of the spacebar make it one of the least awkward keys to press in that situation. And, when you are in typing position, it's pretty much the only key that is constantly under a finger -- you don't really use your thumbs for any other keys that often. It's a very low effort key to press overall (page down, on the other hand, is usually a bit out of the way, and can vary greatly between keyboards).
    – Jason C
    Feb 28, 2014 at 7:21
  • 1
    @JasonC it's not just Chrome using backspace as back, but it's also quite common (and annoying). The rest does make sense, yeah
    – SztupY
    Mar 1, 2014 at 14:28
20

I don't have any evidence that this is the reason the spacebar is used for page down, but back in the day when IBM was setting PC design standards (that still heavily influence the design today), the original IBM AT 84-key keyboard from 1981 (IIRC) did not have page up/down or dedicated arrow keys (they shared the number pad):

enter image description here

The standard 101-key keyboard didn't come on the scene until 3-ish years later. There were competitors to IBM too, and strange alternatives all over the place, e.g. the MIT Space Cadet, which has no page up/down, and has the hand symbols that vaguely resemble arrows:

enter image description here

From the link above re: the hand keys (emphasis mine):

Thumbs- up, down, left, and right keys. It was never quite clear whether these were for answering yes/no questions or for navigation. In the groups that used this keyboard, there was a cultural aversion to arrow keys. To be honest, I'm not sure why any more.

The rapid development of new (and sometimes competing) technologies and interfaces at the time probably led to years of page up/down and arrows being an unreliable / inconsistent source of interaction (and standardization was not as wide-spread at the time), but one key all these keyboards had in common was the spacebar; it has always been around and unchanged.

Also, the mouse didn't really fall into general consumer use until around the same time as the 101-key keyboard; with the first Mac's in 1984, and it raised a lot of eyebrows. It was a while before the mouse was as much of a staple as it is today (and even today a mouse is still a bit of an option; you are far more likely to find a computer with no mouse than with no keyboard).

I imagine that this combined with the usage points jgthms brings up in his answer are the reasons that programs like more (mentioned in Celada's answer) and others used the spacebar so heavily -- more, for example, was written in 1978, well before any truly meaningful standardization of extra keyboard keys. Over time, it probably just stuck.

7
13

From a pure source code perspective, "why" may be hard to answer.

In the latest WebKit, there is no commentary (neither the GTK implementation nor the EFL one):

 case VK_SPACE:
    granularity = WebCore::ScrollByPage;
    if (keyEvent.shiftKey())
        direction = WebCore::ScrollUp;
    else
        direction = WebCore::ScrollDown;
    break;

Rewind the clock back to NCSA Mosaic, no commentary:

  case XK_space:
      XtVaGetValues (win->scrolled_win, XmNverticalScrollBar,
                     (long)(&sb), NULL);
      if (sb && XtIsManaged (sb)) {
          XtCallActionProc (sb, "PageDownOrRight", event, params, 1);
      }
      break;

Go back further to Nexus (nee WorldWideWeb) circa 1992, where there was no keyboard navigation: navigation was done with the mouse.

WWWLineMode circa 1991 did not map space to anything. In WWW/LineMode/Implementation/www.c, the function User_Selection has no reference to space bar. However, it does map new line, that is the ENTER key to next page!

Based on this review, the functionality was introduced in Mosaic. But, I could not find the source for Erwise or ViolaWWW, so maybe there.

Given this, the fact that Mosaic was popular on Windows, and Windows used an IBM AT keyboard, the explanation @JasonC provided seems most likely to me.

2
  • +1 While it cannot answer the question, it's great that this actually shows that this behaviour was there from almost the beginning of browsers (and not coined in IE or Netscape).
    – SztupY
    Mar 3, 2014 at 21:02
  • @SztupY: Yep, indeed. And notice that space bar in Mosaic went page down or right. To my knowledge, space bar never went right anywhere else.
    – bishop
    Mar 3, 2014 at 22:13
4

For me this seems to be a bit counter-intuitive, and also this behaviour affects games and other interactive HTML5 apps, because if you map some action to the space bar it might also scroll down the page, which is not what you want.

The main question about historical background has been covered by other answers, but I thought it would be worth pointing this out. (This would probably be a better fit as a comment, but my lack of reputation points prevents me from commenting.)

Most well-designed pages, games or apps will account for this issue by preventing the default behavior of certain keys (for example, using JavaScript's event.preventDefault()) when the game or app has focus. Focus is most often gained by a page component when a user has clicked/touched/navigated to via tab the component. It can also be assigned programatically. Of course, if you have control over the entire page itself, you could prevent the default behavior of the space bar on the entire page, not just for the app or game.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.