Package: ttyrec Version: 1:1.0.8-4 Severity: wishlist Tags: patch Patch attached.
-- see shy jo
From e4817fb9d270ce9713b8c73c3a35bfc2c5831da0 Mon Sep 17 00:00:00 2001 From: Joey Hess <[email protected]> Date: Tue, 12 Jan 2010 17:59:55 -0500 Subject: [PATCH] ttyplay: Let q key quit playback On nethack.alt.org, they use a version of ttyplay (from the dgamelaunch package) which allows pressing q to quit. I think that's a nice feature so I reimplemented it here. --- ttyplay.1 | 4 +++- ttyplay.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/ttyplay.1 b/ttyplay.1 index c3d1d83..83a3e0c 100644 --- a/ttyplay.1 +++ b/ttyplay.1 @@ -40,7 +40,9 @@ Additionally, there are some special keys defined: .TP .BI 1 set playback to speed 1.0 again. - +.TP +.BI q +quit playback. .SH OPTIONS .TP .BI \-s " SPEED" diff --git a/ttyplay.c b/ttyplay.c index 787dfa9..017152e 100644 --- a/ttyplay.c +++ b/ttyplay.c @@ -118,6 +118,9 @@ ttywait (struct timeval prev, struct timeval cur, double speed) case '1': speed = 1.0; break; + case 'q': + printf("\n"); + exit(0); } drift.tv_sec = drift.tv_usec = 0; } else { -- 1.6.5.7
signature.asc
Description: Digital signature

