curses: ncurses vs Ctrl+Click

Asking curses to report whether the Ctrl key was being pressed during
a mouse click was sending mouse position reports--even those aren't
being requested--and actual Ctrl+Left_click was reporting a pair of
duplicate Ctrl+Mouse_position_report events when a click was actually
performed.  So turn off Ctrl key reporting.

Mac with one-button mouse can be configured to send "secondary click"
for Ctrl+Click.  A laptop trackpad handles that differently (press the
button while two fingers are on the touchpad to send secondary click)
and doesn't support Ctrl+Click as an alternate way to do that.  If this
would work within curses then they could operate the same regardless
of how the user set the mouse or trackpad configuraiton.  But I wasn't
able to make it work right.
This commit is contained in:
PatR
2019-07-09 18:55:10 -07:00
parent 9eefeef5d2
commit 0e8163e341
2 changed files with 19 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.89 $ $NHDT-Date: 1562632673 2019/07/09 00:37:53 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.90 $ $NHDT-Date: 1562723693 2019/07/10 01:54:53 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -174,6 +174,10 @@ curses: when map window was clipped, the 'scrollbars' shown to indicate which
curses: support users's setting for erase char and kill char when getting a
line of input with 'popup_dialog' Off (already supported for popup On)
curses: attempting to use ^H to rush left actually executed ^G (#wizgenesis)
curses: disable the attempt to support Ctrl+Left_click as an alternate way
to generate Right_click for systems with one-button mouse or trackpad;
the mouse data passed to nethack didn't match the curses (ncurses on
OSX 10.11) documentation and things didn't work as intended
curses+'perm_invent': entries were wrapping without any control; usually not
noticeable because next entry overwrote, but visible for final entry
when whole inventory fit within the available height; looked ok with

View File

@@ -877,13 +877,20 @@ curses_convert_keys(int key)
return ret;
}
/* we treat buttons 2 and 3 as equivalent so that it doesn't matter which
one is for right-click and which for middle-click; the core uses CLICK_2
for right-click ("not left" click) even though 2 might be middle button;
we also support Ctrl+left-click as another way to get "not left" click
since Mac is traditionally saddled with a one button mouse or trackpad */
#define MOUSEBUTTONS ((BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED) \
| BUTTON_CTRL)
/*
* We treat buttons 2 and 3 as equivalent so that it doesn't matter which
* one is for right-click and which for middle-click. The core uses CLICK_2
* for right-click ("not left"-click) even though 2 might be middle button.
*
* BUTTON_CTRL was enabled at one point but was not working as intended.
* Ctrl+left_click was generating pairs of duplicated events with Ctrl and
* Report_mouse_position bits set (even though Report_mouse_position wasn't
* enabled) but no button click bit set. (It sort of worked because Ctrl+
* Report_mouse_position wasn't a left click so passed along CLICK_2, but
* the duplication made that too annoying to use. Attempting to immediately
* drain the second one wasn't working as intended either.)
*/
#define MOUSEBUTTONS (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED)
/* Process mouse events. Mouse movement is processed until no further
mouse movement events are available. Returns 0 for a mouse click