From: Pasi Kallinen Date: Wed, 13 Sep 2017 11:02:40 +0000 (+0300) Subject: Win32GUI: Allow toggling mouse_support off X-Git-Tag: NetHack-3.6.1_RC01~368 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e22a9aaf7269107231999ca522512e3a17b5f99;p=nethack Win32GUI: Allow toggling mouse_support off Prevents accidental mouse clicks on the map --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 69444964a..01b5df772 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -529,6 +529,7 @@ win32gui: handle menu_color attribute win32gui: name-from-discoveries list menu selector characters were punctuation instead of letters, repeated for each class; caused by the core bug of erroneously specifying space as a selector for class header lines +win32gui: allow toggling mouse_support off MacOSX: initial binary release was built from out of date source code that had 'BETA' and 'DEBUG' inappropriately enabled MacOSX: force TIMED_DELAY build option on so that 'runmode' run-time option diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 9f4e0103c..7b80cfbc6 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -84,7 +84,7 @@ struct window_procs mswin_procs = { | WC_FONTSIZ_MESSAGE | WC_FONTSIZ_STATUS | WC_FONTSIZ_MENU | WC_FONTSIZ_TEXT | WC_TILE_WIDTH | WC_TILE_HEIGHT | WC_TILE_FILE | WC_VARY_MSGCOUNT | WC_WINDOWCOLORS | WC_PLAYER_SELECTION - | WC_SPLASH_SCREEN | WC_POPUP_DIALOG, + | WC_SPLASH_SCREEN | WC_POPUP_DIALOG | WC_MOUSE_SUPPORT, 0L, mswin_init_nhwindows, mswin_player_selection, mswin_askname, mswin_get_nh_event, mswin_exit_nhwindows, mswin_suspend_nhwindows, mswin_resume_nhwindows, mswin_create_nhwindow, mswin_clear_nhwindow, @@ -212,6 +212,7 @@ mswin_init_nhwindows(int *argc, char **argv) iflags.toptenwin = 1; set_option_mod_status("toptenwin", SET_IN_FILE); //set_option_mod_status("perm_invent", SET_IN_FILE); + set_option_mod_status("mouse_support", SET_IN_GAME); /* initialize map tiles bitmap */ initMapTiles(); @@ -1382,9 +1383,11 @@ mswin_nh_poskey(int *x, int *y, int *mod) mswin_main_loop(); if (event->type == NHEVENT_MOUSE) { - *mod = event->ms.mod; - *x = event->ms.x; - *y = event->ms.y; + if (iflags.wc_mouse_support) { + *mod = event->ms.mod; + *x = event->ms.x; + *y = event->ms.y; + } key = 0; } else { key = event->kbd.ch;