]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-152325: Add curses.has_mouse() and curses.window.mouse_trafo() (GH-152484)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Jun 2026 14:09:03 +0000 (17:09 +0300)
committerGitHub <noreply@github.com>
Sun, 28 Jun 2026 14:09:03 +0000 (14:09 +0000)
commit306d7a7649061d4c88d90deb6838e7e49d03269e
treeb252ccff72e44eb8e49c13f55061c2fd9ffc17b0
parentd831a690766e92b3be5e40134f64407bd041bcbf
gh-152325: Add curses.has_mouse() and curses.window.mouse_trafo() (GH-152484)

has_mouse() reports whether the mouse driver was successfully initialized.

window.mouse_trafo(y, x, to_screen) converts a coordinate pair between
window-relative and screen-relative coordinates, returning the (y, x) pair or
None if it lies outside the window.  Together these complete the curses mouse
interface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/curses.rst
Doc/whatsnew/3.16.rst
Lib/test/test_curses.py
Misc/NEWS.d/next/Library/2026-06-26-21-30-00.gh-issue-152325.Km9xQr.rst [new file with mode: 0644]
Modules/_cursesmodule.c
Modules/clinic/_cursesmodule.c.h