.ds vr "NetHack 3.4
.ds f0 "\*(vr
.ds f1
-.ds f2 "May 11, 2003
+.ds f2 "June 5, 2003
.mt
A Guide to the Mazes of Menace
(Guidebook for NetHack)
.lp "null "
Send padding nulls to the terminal (default off).
.lp number_pad
-Use the number keys to move instead of [yuhjklbn] (default off).
+Use the number keys to move instead of [yuhjklbn] (default 0 or off).
+(number_pad:2 invokes the old DOS behaviour where `5' means `g', meta-`5'
+means `G', and meta-`0' means `I'.)
.lp objects
Set the characters used to display object classes
(default ``])[="(%!?+/$*`0_.'').
\begin{document}
%
% input file: guidebook.mn
-% $Revision: 1.64 $ $Date: 2003/04/05 02:14:51 $
+% $Revision: 1.65 $ $Date: 2003/05/12 03:05:00 $
%
%.ds h0 "
%.ds h1 %.ds h2 \%
%.au
\author{Eric S. Raymond\\
(Extensively edited and expanded for 3.4)}
-\date{May 11, 2003}
+\date{June 5, 2003}
\maketitle
Send padding nulls to the terminal (default off).
%.lp
\item[\ib{number\_pad}]
-Use the number keys to move instead of {\tt [yuhjklbn]} (default off).
+Use the number keys to move instead of {\tt [yuhjklbn]} (default 0 or off).
+(number\_pad:2 invokes the old DOS behaviour where `{\tt 5}' means `{\tt g}',
+meta-`{\tt 5}' means `{\tt G}', and meta-`{\tt 0}' means `{\tt I}'.)
%.lp
\item[\ib{objects}]
Set the characters used to display object classes (default
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
* on some non-move commands */
+ uchar num_pad_mode;
int purge_monsters; /* # of dead monsters still on fmon list */
int *opt_booldup; /* for duplication of boolean opts in config file */
int *opt_compdup; /* for duplication of compound opts in config file */
flags.move = FALSE;
return; /* probably we just had an interrupt */
}
-
+ if (iflags.num_pad && iflags.num_pad_mode == 1) {
+ /* This handles very old inconsistent DOS/Windows behaviour
+ * in a new way: earlier, the keyboard handler mapped these,
+ * which caused counts to be strange when entered from the
+ * number pad. Now do not map them until here.
+ */
+ switch (*cmd) {
+ case '5': *cmd = 'g'; break;
+ case M('5'): *cmd = 'G'; break;
+ case M('0'): *cmd = 'I'; break;
+ }
+ }
/* handle most movement commands */
do_walk = do_rush = prefix_seen = FALSE;
flags.travel = 0;
{"news", (boolean *)0, FALSE, SET_IN_FILE},
#endif
{"null", &flags.null, TRUE, SET_IN_GAME},
- {"number_pad", &iflags.num_pad, FALSE, SET_IN_GAME},
#ifdef MAC
{"page_wait", &flags.page_wait, TRUE, SET_IN_GAME},
#else
# endif
{ "name", "your character's name (e.g., name:Merlin-W)",
PL_NSIZ, DISP_IN_GAME },
+ { "number_pad", "use the number pad", 1, SET_IN_GAME},
{ "objects", "the symbols to use for objects",
MAXOCLASSES, SET_IN_FILE },
{ "packorder", "the inventory order of the items in your pack",
return;
}
+ fullname = "number_pad";
+ if (match_optname(opts, fullname, 10, TRUE)) {
+ boolean compat = (strlen(opts) <= 10);
+ number_pad(iflags.num_pad ? 1 : 0);
+ op = string_for_opt(opts, (compat || !initial));
+ if (!op) {
+ if (compat || negated || initial) {
+ /* for backwards compatibility, "number_pad" without a
+ value is a synonym for number_pad:1 */
+ iflags.num_pad = !negated;
+ if (iflags.num_pad) iflags.num_pad_mode = 0;
+ }
+ return;
+ }
+ if (negated) {
+ bad_negation("number_pad", TRUE);
+ return;
+ }
+ if (*op == '1' || *op == '2') {
+ iflags.num_pad = 1;
+ if (*op == '2') iflags.num_pad_mode = 1;
+ else iflags.num_pad_mode = 0;
+ } else if (*op == '0') {
+ iflags.num_pad = 0;
+ iflags.num_pad_mode = 0;
+ } else badoption(opts);
+ return;
+ }
+
fullname = "runmode";
if (match_optname(opts, fullname, 4, TRUE)) {
if (negated) {
else lan_mail_finish();
}
#endif
- else if ((boolopt[i].addr) == &iflags.num_pad)
- number_pad(iflags.num_pad ? 1 : 0);
-
else if ((boolopt[i].addr) == &flags.lit_corridor) {
/*
* All corridor squares seen via night vision or
{'9', M('9'), '9'}, /* 9 */
{'m', C('p'), C('p')}, /* - */
{'4', M('4'), '4'}, /* 4 */
- {'g', 'G', 'g'}, /* 5 */
+ {'5', M('5'), '5'}, /* 5 */
{'6', M('6'), '6'}, /* 6 */
{'p', 'P', C('p')}, /* + */
{'1', M('1'), '1'}, /* 1 */
{'2', M('2'), '2'}, /* 2 */
{'3', M('3'), '3'}, /* 3 */
- {'i', 'I', C('i')}, /* Ins */
+ {'0', M('0'), '0'}, /* Ins */
{'.', ':', ':'} /* Del */
#endif
};
{'9', M('9'), '9'}, /* 9 */
{'m', C('p'), C('p')}, /* - */
{'4', M('4'), '4'}, /* 4 */
- {'g', 'G', 'g'}, /* 5 */
+ {'5', M('5'), '5'}, /* 5 */
{'6', M('6'), '6'}, /* 6 */
{'+', 'P', C('p')}, /* + */
{'1', M('1'), '1'}, /* 1 */
{'2', M('2'), '2'}, /* 2 */
{'3', M('3'), '3'}, /* 3 */
- {'i', 'I', C('i')}, /* Ins */
+ {'0', M('0'), '0'}, /* Ins */
{'.', ':', ':'} /* Del */
};
{'9', M('9'), '9'}, /* 9 */
{'m', C('p'), C('p')}, /* - */
{'4', M('4'), '4'}, /* 4 */
- {'g', 'G', 'g'}, /* 5 */
+ {'5', M('5'), '5'}, /* 5 */
{'6', M('6'), '6'}, /* 6 */
{'+', 'P', C('p')}, /* + */
{'1', M('1'), '1'}, /* 1 */
{'2', M('2'), '2'}, /* 2 */
{'3', M('3'), '3'}, /* 3 */
- {'i', 'I', C('i')}, /* Ins */
+ {'0', M('0'), '0'}, /* Ins */
{'.', ':', ':'} /* Del */
};