__KEY_BASE
#define __KEY_MAX __KEY_BASE
#define KEY_CODE_YES (__KEY_BASE-1) /* Special indicator. */
#define KEY_BREAK (__KEY_BASE-2) /* Break key (unreliable) */
#define KEY_DOWN (__KEY_BASE-3) /* The four arrow keys ... */
#define KEY_UP (__KEY_BASE-4)
#define KEY_LEFT (__KEY_BASE-5)
#define KEY_RIGHT (__KEY_BASE-6)
#define KEY_HOME (__KEY_BASE-7) /* Move to upper-left corner. */
#define KEY_BACKSPACE (__KEY_BASE-8) /* Backspace */
#define KEY_F0 (__KEY_BASE-9) /* Function keys. Space for */
#define KEY_DL (__KEY_BASE-73) /* Delete line */
#define KEY_IL (__KEY_BASE-74) /* Insert line */
#define KEY_DC (__KEY_BASE-75) /* Delete character */
#define KEY_IC (__KEY_BASE-76) /* Ins char / enter ins mode */
#define KEY_EIC (__KEY_BASE-77) /* Exit insert char mode */
#define KEY_CLEAR (__KEY_BASE-78) /* Clear screen */
#define KEY_EOS (__KEY_BASE-79) /* Clear to end of screen */
#define KEY_EOL (__KEY_BASE-80) /* Clear to end of line */
#define KEY_SF (__KEY_BASE-81) /* Scroll 1 line forward */
#define KEY_SR (__KEY_BASE-82) /* Scroll 1 line backwards */
#define KEY_NPAGE (__KEY_BASE-83) /* Next page */
#define KEY_PPAGE (__KEY_BASE-84) /* Previous page */
#define KEY_STAB (__KEY_BASE-85) /* Set tab */
#define KEY_CTAB (__KEY_BASE-86) /* Clear tab */
#define KEY_CATAB (__KEY_BASE-87) /* Clear all tabs */
#define KEY_ENTER (__KEY_BASE-88) /* Enter or send */
#define KEY_SRESET (__KEY_BASE-89) /* Soft (partial) reset */
#define KEY_RESET (__KEY_BASE-90) /* Hard reset */
#define KEY_PRINT (__KEY_BASE-91) /* Print or copy */
#define KEY_LL (__KEY_BASE-92) /* Move to lower left corner. */
#define KEY_A1 (__KEY_BASE-93) /* Upper left of keypad */
#define KEY_A3 (__KEY_BASE-94) /* Upper rght of keypad */
#define KEY_B2 (__KEY_BASE-95) /* Center of keypad */
#define KEY_C1 (__KEY_BASE-96) /* Lower left of keypad */
#define KEY_C3 (__KEY_BASE-97) /* Lower right of keypad */
#define KEY_BTAB (__KEY_BASE-98) /* Back Tab */
#define KEY_BEG (__KEY_BASE-99) /* Beginning */
#define KEY_CANCEL (__KEY_BASE-100)
#define KEY_CLOSE (__KEY_BASE-101)
#define KEY_COMMAND (__KEY_BASE-102)
#define KEY_COPY (__KEY_BASE-103)
#define KEY_CREATE (__KEY_BASE-104)
#define KEY_END (__KEY_BASE-105)
#define KEY_EXIT (__KEY_BASE-106)
#define KEY_FIND (__KEY_BASE-107)
#define KEY_HELP (__KEY_BASE-108)
#define KEY_MARK (__KEY_BASE-109)
#define KEY_MESSAGE (__KEY_BASE-110)
#define KEY_MOUSE (__KEY_BASE-111) /* Mouse event occured */
#define KEY_MOVE (__KEY_BASE-112)
#define KEY_NEXT (__KEY_BASE-113) /* Next object */
#define KEY_OPEN (__KEY_BASE-114)
#define KEY_OPTIONS (__KEY_BASE-115)
#define KEY_PREVIOUS (__KEY_BASE-116) /* Previous object */
#define KEY_REDO (__KEY_BASE-117)
#define KEY_REFERENCE (__KEY_BASE-118)
#define KEY_REFRESH (__KEY_BASE-119)
#define KEY_REPLACE (__KEY_BASE-120)
#define KEY_RESTART (__KEY_BASE-121)
#define KEY_RESUME (__KEY_BASE-122)
#define KEY_SAVE (__KEY_BASE-123)
#define KEY_SBEG (__KEY_BASE-124) /* Shifted keys */
#define KEY_SCANCEL (__KEY_BASE-125)
#define KEY_SCOMMAND (__KEY_BASE-126)
#define KEY_SCOPY (__KEY_BASE-127)
#define KEY_SCREATE (__KEY_BASE-128)
#define KEY_SDC (__KEY_BASE-129)
#define KEY_SDL (__KEY_BASE-130)
#define KEY_SELECT (__KEY_BASE-131) /* Select */
#define KEY_SEND (__KEY_BASE-132) /* Shifted end key */
#define KEY_SEOL (__KEY_BASE-133)
#define KEY_SEXIT (__KEY_BASE-134)
#define KEY_SFIND (__KEY_BASE-135)
#define KEY_SHELP (__KEY_BASE-136)
#define KEY_SHOME (__KEY_BASE-137)
#define KEY_SIC (__KEY_BASE-138)
#define KEY_SLEFT (__KEY_BASE-139)
#define KEY_SMESSAGE (__KEY_BASE-140)
#define KEY_SMOVE (__KEY_BASE-141)
#define KEY_SNEXT (__KEY_BASE-142)
#define KEY_SOPTIONS (__KEY_BASE-143)
#define KEY_SPREVIOUS (__KEY_BASE-144)
#define KEY_SPRINT (__KEY_BASE-145)
#define KEY_SREDO (__KEY_BASE-146)
#define KEY_SREPLACE (__KEY_BASE-147)
#define KEY_SRIGHT (__KEY_BASE-148)
#define KEY_SRSUME (__KEY_BASE-149)
#define KEY_SSAVE (__KEY_BASE-150)
#define KEY_SSUSPEND (__KEY_BASE-151)
#define KEY_SUNDO (__KEY_BASE-152)
#define KEY_SUSPEND (__KEY_BASE-153)
#define KEY_UNDO (__KEY_BASE-154)
#define __KEY_MIN (__KEY_BASE-155)
if ((ch = wgetch(w)) < __KEY_BASE) {
#define __KEY_MAX __KEY_BASE
#define KEY_CODE_YES (__KEY_BASE-1) /* Special indicator. */
#define KEY_BREAK (__KEY_BASE-2) /* Break key (unreliable) */
#define KEY_DOWN (__KEY_BASE-3) /* The four arrow keys ... */
#define KEY_UP (__KEY_BASE-4)
#define KEY_LEFT (__KEY_BASE-5)
#define KEY_RIGHT (__KEY_BASE-6)
#define KEY_HOME (__KEY_BASE-7) /* Move to upper-left corner. */
#define KEY_BACKSPACE (__KEY_BASE-8) /* Backspace */
#define KEY_F0 (__KEY_BASE-9) /* Function keys. Space for */
#define KEY_DL (__KEY_BASE-73) /* Delete line */
#define KEY_IL (__KEY_BASE-74) /* Insert line */
#define KEY_DC (__KEY_BASE-75) /* Delete character */
#define KEY_IC (__KEY_BASE-76) /* Ins char / enter ins mode */
#define KEY_EIC (__KEY_BASE-77) /* Exit insert char mode */
#define KEY_CLEAR (__KEY_BASE-78) /* Clear screen */
#define KEY_EOS (__KEY_BASE-79) /* Clear to end of screen */
#define KEY_EOL (__KEY_BASE-80) /* Clear to end of line */
#define KEY_SF (__KEY_BASE-81) /* Scroll 1 line forward */
#define KEY_SR (__KEY_BASE-82) /* Scroll 1 line backwards */
#define KEY_NPAGE (__KEY_BASE-83) /* Next page */
#define KEY_PPAGE (__KEY_BASE-84) /* Previous page */
#define KEY_STAB (__KEY_BASE-85) /* Set tab */
#define KEY_CTAB (__KEY_BASE-86) /* Clear tab */
#define KEY_CATAB (__KEY_BASE-87) /* Clear all tabs */
#define KEY_ENTER (__KEY_BASE-88) /* Enter or send */
#define KEY_SRESET (__KEY_BASE-89) /* Soft (partial) reset */
#define KEY_RESET (__KEY_BASE-90) /* Hard reset */
#define KEY_PRINT (__KEY_BASE-91) /* Print or copy */
#define KEY_LL (__KEY_BASE-92) /* Move to lower left corner. */
#define KEY_A1 (__KEY_BASE-93) /* Upper left of keypad */
#define KEY_A3 (__KEY_BASE-94) /* Upper rght of keypad */
#define KEY_B2 (__KEY_BASE-95) /* Center of keypad */
#define KEY_C1 (__KEY_BASE-96) /* Lower left of keypad */
#define KEY_C3 (__KEY_BASE-97) /* Lower right of keypad */
#define KEY_BTAB (__KEY_BASE-98) /* Back Tab */
#define KEY_BEG (__KEY_BASE-99) /* Beginning */
#define KEY_CANCEL (__KEY_BASE-100)
#define KEY_CLOSE (__KEY_BASE-101)
#define KEY_COMMAND (__KEY_BASE-102)
#define KEY_COPY (__KEY_BASE-103)
#define KEY_CREATE (__KEY_BASE-104)
#define KEY_END (__KEY_BASE-105)
#define KEY_EXIT (__KEY_BASE-106)
#define KEY_FIND (__KEY_BASE-107)
#define KEY_HELP (__KEY_BASE-108)
#define KEY_MARK (__KEY_BASE-109)
#define KEY_MESSAGE (__KEY_BASE-110)
#define KEY_MOUSE (__KEY_BASE-111) /* Mouse event occured */
#define KEY_MOVE (__KEY_BASE-112)
#define KEY_NEXT (__KEY_BASE-113) /* Next object */
#define KEY_OPEN (__KEY_BASE-114)
#define KEY_OPTIONS (__KEY_BASE-115)
#define KEY_PREVIOUS (__KEY_BASE-116) /* Previous object */
#define KEY_REDO (__KEY_BASE-117)
#define KEY_REFERENCE (__KEY_BASE-118)
#define KEY_REFRESH (__KEY_BASE-119)
#define KEY_REPLACE (__KEY_BASE-120)
#define KEY_RESTART (__KEY_BASE-121)
#define KEY_RESUME (__KEY_BASE-122)
#define KEY_SAVE (__KEY_BASE-123)
#define KEY_SBEG (__KEY_BASE-124) /* Shifted keys */
#define KEY_SCANCEL (__KEY_BASE-125)
#define KEY_SCOMMAND (__KEY_BASE-126)
#define KEY_SCOPY (__KEY_BASE-127)
#define KEY_SCREATE (__KEY_BASE-128)
#define KEY_SDC (__KEY_BASE-129)
#define KEY_SDL (__KEY_BASE-130)
#define KEY_SELECT (__KEY_BASE-131) /* Select */
#define KEY_SEND (__KEY_BASE-132) /* Shifted end key */
#define KEY_SEOL (__KEY_BASE-133)
#define KEY_SEXIT (__KEY_BASE-134)
#define KEY_SFIND (__KEY_BASE-135)
#define KEY_SHELP (__KEY_BASE-136)
#define KEY_SHOME (__KEY_BASE-137)
#define KEY_SIC (__KEY_BASE-138)
#define KEY_SLEFT (__KEY_BASE-139)
#define KEY_SMESSAGE (__KEY_BASE-140)
#define KEY_SMOVE (__KEY_BASE-141)
#define KEY_SNEXT (__KEY_BASE-142)
#define KEY_SOPTIONS (__KEY_BASE-143)
#define KEY_SPREVIOUS (__KEY_BASE-144)
#define KEY_SPRINT (__KEY_BASE-145)
#define KEY_SREDO (__KEY_BASE-146)
#define KEY_SREPLACE (__KEY_BASE-147)
#define KEY_SRIGHT (__KEY_BASE-148)
#define KEY_SRSUME (__KEY_BASE-149)
#define KEY_SSAVE (__KEY_BASE-150)
#define KEY_SSUSPEND (__KEY_BASE-151)
#define KEY_SUNDO (__KEY_BASE-152)
#define KEY_SUSPEND (__KEY_BASE-153)
#define KEY_UNDO (__KEY_BASE-154)
#define __KEY_MIN (__KEY_BASE-155)
if (ch < __KEY_BASE) {