mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-20 18:29:19 +03:00
Ticket #3954: fix mouse handling with newer terminfo entries.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
9bb351508a
commit
b92c7f86b4
@ -2120,8 +2120,15 @@ tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block)
|
|||||||
#endif /* KEY_MOUSE */
|
#endif /* KEY_MOUSE */
|
||||||
|| c == MCKEY_EXTENDED_MOUSE))
|
|| c == MCKEY_EXTENDED_MOUSE))
|
||||||
{
|
{
|
||||||
/* Mouse event */
|
/* Mouse event. See tickets 2956 and 3954 for extended mode detection. */
|
||||||
xmouse_get_event (event, c == MCKEY_EXTENDED_MOUSE);
|
gboolean extended = c == MCKEY_EXTENDED_MOUSE;
|
||||||
|
|
||||||
|
#ifdef KEY_MOUSE
|
||||||
|
extended = extended || (c == KEY_MOUSE && xmouse_seq == NULL
|
||||||
|
&& xmouse_extended_seq != NULL);
|
||||||
|
#endif /* KEY_MOUSE */
|
||||||
|
|
||||||
|
xmouse_get_event (event, extended);
|
||||||
c = (event->type != 0) ? EV_MOUSE : EV_NONE;
|
c = (event->type != 0) ? EV_MOUSE : EV_NONE;
|
||||||
}
|
}
|
||||||
else if (c == MCKEY_BRACKETED_PASTING_START)
|
else if (c == MCKEY_BRACKETED_PASTING_START)
|
||||||
|
@ -90,8 +90,10 @@ init_mouse (void)
|
|||||||
|
|
||||||
case MOUSE_XTERM_NORMAL_TRACKING:
|
case MOUSE_XTERM_NORMAL_TRACKING:
|
||||||
case MOUSE_XTERM_BUTTON_EVENT_TRACKING:
|
case MOUSE_XTERM_BUTTON_EVENT_TRACKING:
|
||||||
define_sequence (MCKEY_MOUSE, xmouse_seq, MCKEY_NOACTION);
|
if (xmouse_seq != NULL)
|
||||||
define_sequence (MCKEY_EXTENDED_MOUSE, xmouse_extended_seq, MCKEY_NOACTION);
|
define_sequence (MCKEY_MOUSE, xmouse_seq, MCKEY_NOACTION);
|
||||||
|
if (xmouse_extended_seq != NULL)
|
||||||
|
define_sequence (MCKEY_EXTENDED_MOUSE, xmouse_extended_seq, MCKEY_NOACTION);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -361,9 +361,16 @@ tty_init_xterm_support (gboolean is_xterm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No termcap for SGR extended mouse (yet), hardcode it for now */
|
/* There's only one termcap entry "kmous", typically containing "\E[M" or "\E[<".
|
||||||
|
* We need the former in xmouse_seq, the latter in xmouse_extended_seq.
|
||||||
|
* See tickets 2956 and 3954 for details. */
|
||||||
if (xmouse_seq != NULL)
|
if (xmouse_seq != NULL)
|
||||||
|
{
|
||||||
|
if (strcmp (xmouse_seq, ESC_STR "[<") == 0)
|
||||||
|
xmouse_seq = NULL;
|
||||||
|
|
||||||
xmouse_extended_seq = ESC_STR "[<";
|
xmouse_extended_seq = ESC_STR "[<";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
Loading…
Reference in New Issue
Block a user