…ythonGH-152705)
The mouse interface (getmouse(), the BUTTON* constants, ...) was gated on the
ncurses-specific NCURSES_MOUSE_VERSION macro, so it was dropped on other curses
implementations that provide it, such as NetBSD curses and PDCurses.
Gate it instead on a configure capability probe or the PDCURSES macro. Probe
for getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses
declares an incompatible getmouse(void) unless built for the ncurses mouse API,
which PDC_NCMOUSE now always selects.
The is_*() state-query methods named in the original change do not exist on 3.15,
so only the mouse interface is backported.
(cherry picked from commit 7bbea4f)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The mouse interface (getmouse(), the BUTTON* constants, ...) was gated on the ncurses-specific NCURSES_MOUSE_VERSION macro, so it was dropped on other curses implementations that provide it, such as NetBSD curses and PDCurses (the latter underpins windows-curses).
It is now gated on a configure capability probe or the PDCURSES macro. getmouse() is probed with its X/Open getmouse(MEVENT *) signature specifically, because PDCurses declares an incompatible getmouse(void) unless built for the ncurses mouse API; PDC_NCMOUSE is now always defined so PDCurses selects that interface.
The is_*() state-query methods named in the original change (GH-152705) do not exist on 3.14, so only the mouse interface is backported.
Verified by reconfiguring + rebuilding on 3.14 (the probe resolves HAVE_CURSES_GETMOUSE=1) and running test_curses.
(cherry picked from commit 7bbea4f)