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:
nethack.allison
2002-04-04 03:45:03 +00:00
parent 7ca75f5806
commit 69ee06a9bc
12 changed files with 162 additions and 71 deletions

View File

@@ -245,6 +245,10 @@ char *argv[];
process_options(argc, argv);
#endif
#ifdef WIN32CON
toggle_mouse_support(); /* must come after process_options */
#endif
#ifdef MFLOPPY
set_lock_and_bones();
# ifndef AMIGA

View File

@@ -128,6 +128,7 @@ int *wid, *hgt;
if (twid > 80) twid = 80;
*wid = twid;
*hgt = origcsbi.srWindow.Bottom - origcsbi.srWindow.Top;
set_option_mod_status("mouse_support", SET_IN_GAME);
}
void
@@ -225,16 +226,18 @@ nttty_open()
0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,0);
#endif
GetConsoleMode(hConIn,&cmode);
#ifndef NO_MOUSE_ALLOWED
mask = ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
ENABLE_ECHO_INPUT | ENABLE_WINDOW_INPUT;
#else
#ifdef NO_MOUSE_ALLOWED
mask = ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
ENABLE_MOUSE_INPUT | ENABLE_ECHO_INPUT | ENABLE_WINDOW_INPUT;
#else
mask = ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
ENABLE_ECHO_INPUT | ENABLE_WINDOW_INPUT;
#endif
/* Turn OFF the settings specified in the mask */
cmode &= ~mask;
#ifndef NO_MOUSE_ALLOWED
cmode |= ENABLE_MOUSE_INPUT;
#endif
SetConsoleMode(hConIn,cmode);
if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE)) {
/* Unable to set control handler */
@@ -484,7 +487,7 @@ nttty_kbhit()
retval = 1;
}
else /* Discard it, its an insignificant event */
else /* Discard it, it's an insignificant event */
ReadConsoleInput(hConIn,&ir,1,&count);
} else /* There are no events in console event queue */ {
done = 1; /* Stop looking */
@@ -862,4 +865,29 @@ standoutend()
colorchange = TRUE;
}
#ifndef NO_MOUSE_ALLOWED
void
toggle_mouse_support()
{
DWORD cmode;
GetConsoleMode(hConIn,&cmode);
if (iflags.wc_mouse_support)
cmode |= ENABLE_MOUSE_INPUT;
else
cmode &= ~ENABLE_MOUSE_INPUT;
SetConsoleMode(hConIn,cmode);
}
#endif
/* handle tty options updates here */
void nttty_preference_update(pref)
const char *pref;
{
if( stricmp( pref, "mouse_support")==0) {
#ifndef NO_MOUSE_ALLOWED
toggle_mouse_support();
#endif
}
return;
}
#endif /* WIN32CON */