Make the reset a gesture rather than a key
Control, Alt and Delete, which was F12. Two reasons, and the first one is about hardware rather than about the emulator. ON REAL HARDWARE THIS IS NOT A KEY AT ALL. A Voyager has a button on the case, and what a window has instead of a case is a gesture standing in for one. So it must not be a key software might want - a machine with a keyboard has function keys on it and something will eventually have a use for F12, which would have meant taking it away again later, from programs already written to expect it. And it must not be reachable by accident. Restarting throws away everything in memory, which is the same data loss Escape was one keypress from causing, arriving by a different door. Three keys together are not pressed by mistake. It has meant this since 1981, so it is also the one gesture nobody has to be told the meaning of - and Delete stays free for software, since the gesture is all three or nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
f7657081be
commit
0afead00de
@@ -128,19 +128,32 @@ static void drainKeyboard(void) {
|
||||
|
||||
// ---- The reset button ----
|
||||
//
|
||||
// F12, because it is a button on the case rather than a key the machine can see: nothing
|
||||
// sends a function key to the console, so nothing can be surprised by one. What it does is
|
||||
// exactly what writing MACHINE_RESET does - the machine starts the way it started, which
|
||||
// means the boot chain runs again and finds whatever the disk now says to run.
|
||||
// ON REAL HARDWARE THIS IS NOT A KEY AT ALL. A Voyager has a button on the case, and what a
|
||||
// window has instead of a case is a gesture. So the gesture wants two properties a single
|
||||
// key does not have.
|
||||
//
|
||||
// Which is what makes a bare metal program escapable. Once puts a demo in front of the next
|
||||
// start and deletes the request before jumping, so a demo that has taken the whole machine
|
||||
// is one keypress away from the system coming back - and nobody has to close the window and
|
||||
// open it again to get there.
|
||||
// It must not be a key SOFTWARE MIGHT WANT. A machine with a keyboard has function keys on
|
||||
// it, and something will eventually have a use for F12 - which is where this was, and which
|
||||
// would have meant taking it away again later.
|
||||
//
|
||||
// And it must not be reachable BY ACCIDENT. Restarting the machine throws away everything in
|
||||
// memory, and a single key that does that sits one mistake away from losing work. Three keys
|
||||
// together are not pressed by mistake.
|
||||
//
|
||||
// Control, Alt and Delete, which has meant this since 1981 and is the one gesture nobody has
|
||||
// to be told the meaning of.
|
||||
//
|
||||
// What it does is what writing MACHINE_RESET does: the machine starts the way it started, so
|
||||
// the boot chain runs again and finds whatever the disk now says to run. Which is what makes
|
||||
// a bare metal program escapable - Once puts a demo in front of the next start and deletes
|
||||
// the request before jumping, so a demo that has taken the whole machine is one gesture from
|
||||
// the system coming back, rather than closing the window and opening it again.
|
||||
static int resetPending = 0;
|
||||
|
||||
static void checkResetButton(void) {
|
||||
if (IsKeyPressed(KEY_F12)) {
|
||||
const int control = IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL);
|
||||
const int alt = IsKeyDown(KEY_LEFT_ALT) || IsKeyDown(KEY_RIGHT_ALT);
|
||||
if (control && alt && IsKeyPressed(KEY_DELETE)) {
|
||||
requestReset();
|
||||
// Remembered as well as asked for, so that a machine waiting on a key can be woken
|
||||
// to go and notice it. See voyagerKey.
|
||||
|
||||
Reference in New Issue
Block a user