Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add curses state-query functions: is_keypad, is_cbreak, getparent, etc. #151776

Description

@serhiy-storchaka

ncurses provides "opaque" accessors that report state which the standard :mod:curses API can only set, never read back. These are not currently wrapped.

The window getters is_cleared, is_idcok, is_idlok, is_immedok, is_keypad, is_leaveok, is_nodelay, is_notimeout, is_pad, is_scrollok, is_subwin and is_syncok each return the value set by the matching setter (or, for is_pad/is_subwin, the kind of window).

The window value getters getdelay() (wgetdelay), getscrreg() (wgetscrreg) and getparent() (wgetparent) return the read timeout in milliseconds, the current scrolling region as a tuple, and the parent window (or None).

The module functions is_cbreak, is_echo, is_nl and is_raw report the current terminal mode set by cbreak, echo, nl and raw.

All of these are available when CPython is built against an ncurses with NCURSES_EXT_FUNCS (ncurses 5.9 and later).

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions