Two new options
Add "travel" boolean option to enable/disable travel command. Add "mouse_support" wincap option to enable/disable mouse. - When running the win32 tty version full-screen, some people complained about the square mouse cursor. Newsgroups: rec.games.roguelike.nethack Subject: Re: Getting rid of the cursor? <email deleted> <email deleted> Followup-To: On Thu, 04 Apr 2002 00:20:06 <email deleted> wrote: > Ok, let me be more specific: when playing the windows non-GUI version, is > there a way to get rid of the large rectangular white cursor? > > <email deleted> wrote in message > <email deleted> >> Can you get rid of the cursor in the windows version? I really hate that >> thing. >> <email deleted> >Newsgroups: rec.games.roguelike.nethack >Subject: Disabling Mouse Input > >I purchased an older P120 laptop to be able to play Nethack at the hotel. >I find that I rest my thumbs on the mouse touch pad all too often and my >@ moves unexpectedly at times. I took a peruse through defaults.nh, but >came up empty. > >Anyone know if mouse input can be disabled? > >MRSisson
This commit is contained in:
140
src/cmd.c
140
src/cmd.c
@@ -1738,11 +1738,14 @@ register char *cmd;
|
||||
multi = 0;
|
||||
return;
|
||||
case CMD_TRAVEL:
|
||||
flags.travel = 1;
|
||||
flags.run = 8;
|
||||
flags.nopick = 1;
|
||||
do_rush = TRUE;
|
||||
break;
|
||||
if (iflags.travelcmd) {
|
||||
flags.travel = 1;
|
||||
flags.run = 8;
|
||||
flags.nopick = 1;
|
||||
do_rush = TRUE;
|
||||
break;
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
default: if (movecmd(*cmd)) { /* ordinary movement */
|
||||
do_walk = TRUE;
|
||||
} else if (movecmd(iflags.num_pad ?
|
||||
@@ -1936,62 +1939,81 @@ click_to_cmd(x, y, mod)
|
||||
x -= u.ux;
|
||||
y -= u.uy;
|
||||
|
||||
if ( abs(x) <= 1 && abs(y) <= 1 ) {
|
||||
x = sgn(x), y = sgn(y);
|
||||
if (iflags.travelcmd) {
|
||||
if (abs(x) <= 1 && abs(y) <= 1 ) {
|
||||
x = sgn(x), y = sgn(y);
|
||||
} else {
|
||||
u.tx = u.ux+x;
|
||||
u.ty = u.uy+y;
|
||||
cmd[0] = CMD_TRAVEL;
|
||||
return cmd;
|
||||
}
|
||||
|
||||
if(x == 0 && y == 0) {
|
||||
/* here */
|
||||
if(IS_FOUNTAIN(levl[u.ux][u.uy].typ) || IS_SINK(levl[u.ux][u.uy].typ)) {
|
||||
cmd[0]=mod == CLICK_1 ? 'q' : M('d');
|
||||
return cmd;
|
||||
} else if(IS_THRONE(levl[u.ux][u.uy].typ)) {
|
||||
cmd[0]=M('s');
|
||||
return cmd;
|
||||
} else if((u.ux == xupstair && u.uy == yupstair)
|
||||
|| (u.ux == sstairs.sx && u.uy == sstairs.sy && sstairs.up)
|
||||
|| (u.ux == xupladder && u.uy == yupladder)) {
|
||||
return "<";
|
||||
} else if((u.ux == xdnstair && u.uy == ydnstair)
|
||||
|| (u.ux == sstairs.sx && u.uy == sstairs.sy && !sstairs.up)
|
||||
|| (u.ux == xdnladder && u.uy == ydnladder)) {
|
||||
return ">";
|
||||
} else if(OBJ_AT(u.ux, u.uy)) {
|
||||
cmd[0] = Is_container(level.objects[u.ux][u.uy]) ? M('l') : ',';
|
||||
return cmd;
|
||||
} else {
|
||||
return "."; /* just rest */
|
||||
}
|
||||
}
|
||||
|
||||
/* directional commands */
|
||||
|
||||
dir = xytod(x, y);
|
||||
|
||||
if (!m_at(u.ux+x, u.uy+y) && !test_move(u.ux, u.uy, x, y, 1)) {
|
||||
cmd[1] = (iflags.num_pad ? ndir[dir] : sdir[dir]);
|
||||
cmd[2] = 0;
|
||||
if (IS_DOOR(levl[u.ux+x][u.uy+y].typ)) {
|
||||
/* slight assistance to the player: choose kick/open for them */
|
||||
if (levl[u.ux+x][u.uy+y].doormask & D_LOCKED) {
|
||||
cmd[0] = C('d');
|
||||
return cmd;
|
||||
}
|
||||
if (levl[u.ux+x][u.uy+y].doormask & D_CLOSED) {
|
||||
cmd[0] = 'o';
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
if (levl[u.ux+x][u.uy+y].typ <= SCORR) {
|
||||
cmd[0] = 's';
|
||||
cmd[1] = 0;
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
u.tx = u.ux+x;
|
||||
u.ty = u.uy+y;
|
||||
cmd[0] = CMD_TRAVEL;
|
||||
return cmd;
|
||||
}
|
||||
/* convert without using floating point, allowing sloppy clicking */
|
||||
if(x > 2*abs(y))
|
||||
x = 1, y = 0;
|
||||
else if(y > 2*abs(x))
|
||||
x = 0, y = 1;
|
||||
else if(x < -2*abs(y))
|
||||
x = -1, y = 0;
|
||||
else if(y < -2*abs(x))
|
||||
x = 0, y = -1;
|
||||
else
|
||||
x = sgn(x), y = sgn(y);
|
||||
|
||||
if(x == 0 && y == 0) {
|
||||
/* here */
|
||||
if(IS_FOUNTAIN(levl[u.ux][u.uy].typ) || IS_SINK(levl[u.ux][u.uy].typ)) {
|
||||
cmd[0]=mod == CLICK_1 ? 'q' : M('d');
|
||||
return cmd;
|
||||
} else if(IS_THRONE(levl[u.ux][u.uy].typ)) {
|
||||
cmd[0]=M('s');
|
||||
return cmd;
|
||||
} else if((u.ux == xupstair && u.uy == yupstair)
|
||||
|| (u.ux == sstairs.sx && u.uy == sstairs.sy && sstairs.up)
|
||||
|| (u.ux == xupladder && u.uy == yupladder)) {
|
||||
return "<";
|
||||
} else if((u.ux == xdnstair && u.uy == ydnstair)
|
||||
|| (u.ux == sstairs.sx && u.uy == sstairs.sy && !sstairs.up)
|
||||
|| (u.ux == xdnladder && u.uy == ydnladder)) {
|
||||
return ">";
|
||||
} else if(OBJ_AT(u.ux, u.uy)) {
|
||||
cmd[0] = Is_container(level.objects[u.ux][u.uy]) ? M('l') : ',';
|
||||
return cmd;
|
||||
} else {
|
||||
return "."; /* just rest */
|
||||
}
|
||||
}
|
||||
if(x == 0 && y == 0) /* map click on player to "rest" command */
|
||||
return ".";
|
||||
|
||||
/* directional commands */
|
||||
|
||||
dir = xytod(x, y);
|
||||
|
||||
if (!m_at(u.ux+x, u.uy+y) && !test_move(u.ux, u.uy, x, y, 1)) {
|
||||
cmd[1] = (iflags.num_pad ? ndir[dir] : sdir[dir]);
|
||||
cmd[2] = 0;
|
||||
if (IS_DOOR(levl[u.ux+x][u.uy+y].typ)) {
|
||||
/* slight assistance to the player: choose kick/open for them */
|
||||
if (levl[u.ux+x][u.uy+y].doormask & D_LOCKED) {
|
||||
cmd[0] = C('d');
|
||||
return cmd;
|
||||
}
|
||||
if (levl[u.ux+x][u.uy+y].doormask & D_CLOSED) {
|
||||
cmd[0] = 'o';
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
if (levl[u.ux+x][u.uy+y].typ <= SCORR) {
|
||||
cmd[0] = 's';
|
||||
cmd[1] = 0;
|
||||
return cmd;
|
||||
}
|
||||
dir = xytod(x, y);
|
||||
}
|
||||
|
||||
/* move, attack, etc. */
|
||||
@@ -2142,6 +2164,8 @@ dotravel()
|
||||
/* Keyboard travel command */
|
||||
static char cmd[2];
|
||||
coord cc;
|
||||
|
||||
if (!iflags.travelcmd) return 0;
|
||||
cmd[1]=0;
|
||||
cc.x = u.ux;
|
||||
cc.y = u.uy;
|
||||
|
||||
@@ -128,6 +128,7 @@ static struct Bool_Opt
|
||||
#else
|
||||
{"msg_window", (boolean *)0, FALSE, SET_IN_FILE},
|
||||
#endif
|
||||
{"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/
|
||||
#ifdef NEWS
|
||||
{"news", &iflags.news, TRUE, DISP_IN_GAME},
|
||||
#else
|
||||
@@ -183,6 +184,7 @@ static struct Bool_Opt
|
||||
#endif
|
||||
{"tombstone",&flags.tombstone, TRUE, SET_IN_GAME},
|
||||
{"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME},
|
||||
{"travel", &iflags.travelcmd, TRUE, SET_IN_GAME},
|
||||
{"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
|
||||
{"verbose", &flags.verbose, TRUE, SET_IN_GAME},
|
||||
{(char *)0, (boolean *)0, FALSE, 0}
|
||||
@@ -2990,6 +2992,7 @@ struct wc_Opt wc_options[] = {
|
||||
{"hilite_pet", WC_HILITE_PET},
|
||||
{"large_font", WC_LARGE_FONT}, /* now obsolete */
|
||||
{"popup_dialog", WC_POPUP_DIALOG},
|
||||
{"player_selection", WC_PLAYER_SELECTION},
|
||||
{"preload_tiles", WC_PRELOAD_TILES},
|
||||
{"tiled_map", WC_TILED_MAP},
|
||||
{"tile_file", WC_TILE_FILE},
|
||||
@@ -3013,7 +3016,10 @@ struct wc_Opt wc_options[] = {
|
||||
{"font_text", WC_FONT_TEXT},
|
||||
{"map_mode", WC_MAP_MODE},
|
||||
{"scroll_margin", WC_SCROLL_MARGIN},
|
||||
{"splash_screen", WC_SPLASH_SCREEN},
|
||||
{"vary_msgcount",WC_VARY_MSGCOUNT},
|
||||
{"windowcolors", WC_WINDOWCOLORS},
|
||||
{"mouse_support", WC_MOUSE_SUPPORT},
|
||||
{(char *)0, 0L}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user