On this page
curses.has_key
Prev: curses.has_il | Up: curses | Next: curses.init_color
Rel: curses.assume_default_colors, curses.baudrate, curses.beep, curses.can_change_color
Ref: docs.python.org — curses.has_key
Tags: #public #python3 #stdlib #curses
Import
import curses
from curses import has_key
Signature & Overview
curses.has_key(key, /)
Return True if the current terminal type recognizes a key with that value.
Usage
import curses
# Checks whether the current terminal recognizes a KEY_* constant (e.g. KEY_UP)
assert callable(curses.has_key)
Gotchas
- Enable
stdscr.keypad(True)so arrow and function keys decode intocurses.KEY_*codes.
REPL Inspect
from curses import has_key
help(has_key)
Linked from
Related notes
- tuts/python3/stdlib_module/curses/has_il Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/init_color Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/curses/assume_default_colors Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/baudrate Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/beep Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/can_change_color Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/cbreak shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_content shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_pair shared tags: #curses, #stdlib