Mercurial > hg > nnchat
comparison nnchat.c @ 341:ece94ae2a051
Handling of certain Curses keycodes only works as intended under
PDCurses (Win32), so #ifdef the code out when working under NCurses.
Specifically KEY_RESIZE's code is defined differently under NCurses vs.
PDCurses, causing problems with terminal resizes if the PDCurses specific
key handling code is enabled.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 23 Jun 2011 01:22:44 +0300 |
parents | cbbe2e797f55 |
children | adc615a6b4e5 |
comparison
equal
deleted
inserted
replaced
340:cbbe2e797f55 | 341:ece94ae2a051 |
---|---|
1578 } | 1578 } |
1579 else { | 1579 else { |
1580 if (optDebug) | 1580 if (optDebug) |
1581 printMsg(currWin, "Unhandled ESC key sequence 0x%02x\n", c); | 1581 printMsg(currWin, "Unhandled ESC key sequence 0x%02x\n", c); |
1582 } | 1582 } |
1583 } else | 1583 } |
1584 #if defined(__WIN32) && defined(PDCURSES) | |
1585 else | |
1584 if (c >= 0x198 && c <= 0x1a0) { | 1586 if (c >= 0x198 && c <= 0x1a0) { |
1585 /* Chat window switching via Meta/Esc-[1..9] */ | 1587 /* Chat window switching via Meta/Esc-[1..9] */ |
1586 int win = c - 0x198; | 1588 int win = c - 0x198; |
1587 if (win < SET_MAX_WINDOWS && chatWindows[win] != NULL) { | 1589 if (win < SET_MAX_WINDOWS && chatWindows[win] != NULL) { |
1588 currWin = chatWindows[win]; | 1590 currWin = chatWindows[win]; |
1589 update = updateMain = TRUE; | 1591 update = updateMain = TRUE; |
1590 } | 1592 } |
1591 c = ERR; | 1593 c = ERR; |
1592 } | 1594 } |
1595 #endif | |
1593 | 1596 |
1594 switch (c) { | 1597 switch (c) { |
1595 #ifdef KEY_RESIZE | 1598 #ifdef KEY_RESIZE |
1596 case KEY_RESIZE: | 1599 case KEY_RESIZE: |
1597 resize_term(0, 0); | 1600 resize_term(0, 0); |