Skip to content

gh-152325: Add curses.has_mouse() and curses.window.mouse_trafo()#152484

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-mouse
Jun 28, 2026
Merged

gh-152325: Add curses.has_mouse() and curses.window.mouse_trafo()#152484
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-mouse

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Add the two remaining pieces of the curses mouse interface.

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

curses.window.mouse_trafo(y, x, to_screen) converts a coordinate pair between window-relative and screen-relative (stdscr-relative) coordinates, returning the converted (y, x) tuple, or None if the point lies outside the window. Modeled on the existing window.enclose(), with the same NCURSES_MOUSE_VERSION guard.

🤖 Generated with Claude Code

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>
@read-the-docs-community

read-the-docs-community Bot commented Jun 28, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33343614 | 📁 Comparing bd11179 against main (65585ca)

  🔍 Preview build  

3 files changed
± library/curses.html
± whatsnew/3.16.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 28, 2026 13:39
@serhiy-storchaka serhiy-storchaka merged commit 306d7a7 into python:main Jun 28, 2026
53 of 54 checks passed
@serhiy-storchaka serhiy-storchaka deleted the curses-mouse branch July 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant