summaryrefslogtreecommitdiffstats
path: root/boggle
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-08-09 14:29:40 +0000
committerchristos <christos@NetBSD.org>2006-08-09 14:29:40 +0000
commit946163e15ca96c766ee456229c7bc3925ba80211 (patch)
treeccd34c510214e874761a2793a4cb238e0a607bdd /boggle
parent3748e584d42e73bc48d6b26c52a093ad7d77732c (diff)
downloadbsdgames-darwin-946163e15ca96c766ee456229c7bc3925ba80211.tar.gz
bsdgames-darwin-946163e15ca96c766ee456229c7bc3925ba80211.tar.zst
bsdgames-darwin-946163e15ca96c766ee456229c7bc3925ba80211.zip
PR/34175: Zafer Aydogan: touch the window to cause a refresh after help
Also use CTRL instead of \xxx
Diffstat (limited to 'boggle')
-rw-r--r--boggle/boggle/bog.c13
-rw-r--r--boggle/boggle/mach.c25
2 files changed, 20 insertions, 18 deletions
diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c
index fb55923b..f46befdd 100644
--- a/boggle/boggle/bog.c
+++ b/boggle/boggle/bog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bog.c,v 1.20 2005/07/01 16:38:24 jmc Exp $ */
+/* $NetBSD: bog.c,v 1.21 2006/08/09 14:29:40 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\
#if 0
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: bog.c,v 1.20 2005/07/01 16:38:24 jmc Exp $");
+__RCSID("$NetBSD: bog.c,v 1.21 2006/08/09 14:29:40 christos Exp $");
#endif
#endif /* not lint */
@@ -53,6 +53,7 @@ __RCSID("$NetBSD: bog.c,v 1.20 2005/07/01 16:38:24 jmc Exp $");
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <sys/tty.h>
#include "bog.h"
#include "extern.h"
@@ -242,9 +243,9 @@ main(int argc, char *argv[])
for (;;) {
ch = inputch();
#ifdef NEW_STYLE
- if (ch == '\033')
+ if (ch == '\e')
findword();
- else if (ch == '\014' || ch == '\022') /* ^l or ^r */
+ else if (ch == CTRL('l') || ch == CTRL('r'))
redraw();
else {
if (ch == 'q') {
@@ -255,9 +256,9 @@ main(int argc, char *argv[])
}
}
#else
- if (ch == '\033')
+ if (ch == '\e')
findword();
- else if (ch == '\014' || ch == '\022') /* ^l or ^r */
+ else if (ch == CTRL('l') || ch == CTRL('r'))
redraw();
else {
if (isupper(ch)) {
diff --git a/boggle/boggle/mach.c b/boggle/boggle/mach.c
index 7efc8de5..b88a5b07 100644
--- a/boggle/boggle/mach.c
+++ b/boggle/boggle/mach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mach.c,v 1.15 2005/07/01 16:38:24 jmc Exp $ */
+/* $NetBSD: mach.c,v 1.16 2006/08/09 14:29:40 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93";
#else
-__RCSID("$NetBSD: mach.c,v 1.15 2005/07/01 16:38:24 jmc Exp $");
+__RCSID("$NetBSD: mach.c,v 1.16 2006/08/09 14:29:40 christos Exp $");
#endif
#endif /* not lint */
@@ -178,11 +178,11 @@ getline(char *q)
case ' ':
done = 1;
break;
- case '\033':
+ case '\e':
findword();
break;
case '\177': /* <del> */
- case '\010': /* <bs> */
+ case CTRL('h'): /* <bs> */
if (p == q)
break;
p--;
@@ -191,8 +191,8 @@ getline(char *q)
clrtoeol();
refresh();
break;
- case '\025': /* <^u> */
- case '\027': /* <^w> */
+ case CTRL('u'): /* <^u> */
+ case CTRL('w'): /* <^w> */
if (p == q)
break;
getyx(stdscr, row, col);
@@ -202,11 +202,11 @@ getline(char *q)
refresh();
break;
#ifdef SIGTSTP
- case '\032': /* <^z> */
+ case CTRL('z'): /* <^z> */
stop_catcher(0);
break;
#endif
- case '\023': /* <^s> */
+ case CTRL('s'): /* <^s> */
stoptime();
printw("<PAUSE>");
refresh();
@@ -217,22 +217,23 @@ getline(char *q)
refresh();
starttime();
break;
- case '\003': /* <^c> */
+ case CTRL('c'): /* <^c> */
cleanup();
exit(0);
/*NOTREACHED*/
- case '\004': /* <^d> */
+ case CTRL('d'): /* <^d> */
done = 1;
ch = EOF;
break;
- case '\014': /* <^l> */
- case '\022': /* <^r> */
+ case CTRL('r'): /* <^l> */
+ case CTRL('l'): /* <^r> */
redraw();
break;
case '?':
stoptime();
if (help() < 0)
showstr("Can't open help file", 1);
+ touchwin(stdscr);
starttime();
break;
default: