Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getch(3cur)

keypad(3cur)

Name

keypad − enable keypad

Syntax

#include <cursesX.h>

int keypad(win, bf)
WINDOW ∗win;
bool bf;

Description

This option enables the keypad of the user’s terminal.  If the keypad is enabled, pressing a function key (such as an arrow key) will return a single value representing the function key.  For example, pressing the left arrow key results in the value KEY_LEFT being returned..  For more information see the Guide to X/Open Curses Screen-Handling. 

The routine getch is used to return the character. If the keypad is disabled, curses does not treat function keys as special keys and the program interprets the escape sequences itself. Keypad layout is terminal dependent; some terminals do not even have a keypad.

Return Values

The keypad function returns OK on success and ERR on error.

See Also

getch(3cur)
Guide to X/Open Curses Screen-Handling

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026