Removed PDC_validchar() etc. This still needs a lot more work.

This commit is contained in:
William McBrine
2006-10-24 00:12:32 +00:00
parent f3b0d01e62
commit 55109b4a58
6 changed files with 39 additions and 191 deletions

View File

@@ -11,7 +11,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curspriv.h,v 1.129 2006/10/15 02:42:24 wmcbrine Exp $ */
/* $Id: curspriv.h,v 1.130 2006/10/24 00:12:31 wmcbrine Exp $ */
/* CURSPRIV.H
@@ -57,7 +57,6 @@
extern bool pdc_trace_on; /* tracing flag */
extern bool pdc_color_started;
extern WINDOW *pdc_getch_win;
extern unsigned long pdc_key_modifiers;
extern MOUSE_STATUS pdc_mouse_status;
extern unsigned char *pdc_atrtab;
@@ -96,7 +95,6 @@ int PDC_set_ctrl_break(bool);
void PDC_set_keyboard_binary(bool);
void PDC_sync(WINDOW *);
void PDC_transform_line(int, int, int, const chtype *);
int PDC_validchar(int);
const char *PDC_sysname(void);
#ifdef PDCDEBUG

View File

@@ -19,7 +19,7 @@
#include "pdcdos.h"
RCSID("$Id: pdckbd.c,v 1.43 2006/10/19 01:54:47 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.44 2006/10/24 00:12:31 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -163,33 +163,17 @@ bool PDC_check_bios_key(void)
return kbhit();
}
/*man-start**************************************************************
/* Formerly PDC_get_bios_key() -- this returns the next key available
from the BIOS. If the low 8 bits are 0, the upper bits contain the
extended character code. If bit 0-7 are non-zero, the upper bits = 0.
*/
PDC_get_bios_key() - Returns the next key available from the BIOS.
PDCurses Description:
This is a private PDCurses routine.
Returns the next key code struck at the keyboard. If the low 8
bits are 0, the upper bits contain the extended character
code. If bit 0-7 are non-zero, the upper bits = 0.
PDCurses Return Value:
This function returns OK on success and ERR on error.
Portability:
PDCurses int PDC_get_bios_key(void);
**man-end****************************************************************/
int PDC_get_bios_key(void)
static int _key_core(void)
{
PDCREGS regs;
int ascii, scan;
static unsigned char keyboard_function = 0xFF;
PDC_LOG(("PDC_get_bios_key() - called\n"));
if (keyboard_function == 0xFF)
{
/* get shift status for all keyboards */
@@ -364,47 +348,31 @@ int PDC_set_ctrl_break(bool setting)
/*man-start**************************************************************
PDC_validchar() - validate/translate passed character
PDC_get_bios_key() - Returns the next key available.
PDCurses Description:
This is a private PDCurses function.
Checks that 'c' is a valid character, and if so returns it,
with function key translation applied if 'w' has keypad mode
set. If char is invalid, returns -1.
PDCurses Return Value:
This function returns -1 if the passed character is invalid, or
the WINDOW* 'w' is NULL, or 'w's keypad is not active.
Otherwise, this function returns the PDCurses equivalent of the
passed character. See the function key and key macros in
<curses.h>
This is a private PDCurses routine.
Returns the next key code struck at the keyboard.
Portability:
PDCurses int PDC_validchar(int c);
PDCurses int PDC_get_bios_key(void);
**man-end****************************************************************/
int PDC_validchar(int c)
int PDC_get_bios_key()
{
int *scanp;
int c, *scanp;
PDC_LOG(("PDC_validchar() - called\n"));
PDC_LOG(("PDC_get_bios_key() - called\n"));
if (pdc_getch_win == (WINDOW *)NULL)
return -1;
c = _key_core();
/* normal character */
if ((unsigned int)c < 256)
return c;
/* skip if keys if !keypad mode */
if (!(pdc_getch_win->_use_keypad))
return -1;
/* Under DOS, extended keys are in the upper byte. Shift down
for a comparison. */

View File

@@ -30,7 +30,7 @@ static int tahead = -1;
static KBDINFO kbdinfo; /* default keyboard mode */
#endif
RCSID("$Id: pdckbd.c,v 1.42 2006/10/15 02:42:25 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.43 2006/10/24 00:12:31 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -249,26 +249,7 @@ bool PDC_check_bios_key(void)
#endif
}
/*man-start**************************************************************
PDC_get_bios_key() - Returns the next key available from the BIOS.
PDCurses Description:
This is a private PDCurses routine.
Returns the next key code struck at the keyboard. If the low 8
bits are 0, the upper bits contain the extended character
code. If bit 0-7 are non-zero, the upper bits = 0.
PDCurses Return Value:
This function returns OK on success and ERR on error.
Portability:
PDCurses int PDC_get_bios_key(void);
**man-end****************************************************************/
int PDC_get_bios_key(void)
static int _key_core(void)
{
int ascii, scan, key;
#ifndef EMXVIDEO
@@ -472,47 +453,31 @@ int PDC_set_ctrl_break(bool setting)
/*man-start**************************************************************
PDC_validchar() - validate/translate passed character
PDC_get_bios_key() - Returns the next key available.
PDCurses Description:
This is a private PDCurses function.
Checks that 'c' is a valid character, and if so returns it,
with function key translation applied if 'w' has keypad mode
set. If char is invalid, returns -1.
PDCurses Return Value:
This function returns -1 if the passed character is invalid, or
the WINDOW* 'w' is NULL, or 'w's keypad is not active.
Otherwise, this function returns the PDCurses equivalent of the
passed character. See the function key and key macros in
<curses.h>
This is a private PDCurses routine.
Returns the next key code struck at the keyboard.
Portability:
PDCurses int PDC_validchar(int c);
PDCurses int PDC_get_bios_key(void);
**man-end****************************************************************/
int PDC_validchar(int c)
int PDC_get_bios_key(void)
{
int *scanp;
int c, *scanp;
PDC_LOG(("PDC_validchar() - called. c: %d\n", c));
PDC_LOG(("PDC_get_bios_key()\n"));
if (pdc_getch_win == (WINDOW *)NULL)
return -1;
c = _key_core();
/* normal character */
if ((unsigned int)c < 256)
return c;
/* skip if keys if !keypad mode */
if (!pdc_getch_win->_use_keypad)
return -1;
/* Under DOS, extended keys are in the upper byte. Shift down
for a comparison. */

View File

@@ -16,7 +16,7 @@
#define _INBUFSIZ 512 /* size of terminal input buffer */
#define NUNGETCH 256 /* max # chars to ungetch() */
RCSID("$Id: getch.c,v 1.42 2006/10/23 05:47:34 wmcbrine Exp $");
RCSID("$Id: getch.c,v 1.43 2006/10/24 00:12:31 wmcbrine Exp $");
static int c_pindex = 0; /* putter index */
static int c_gindex = 1; /* getter index */
@@ -100,7 +100,7 @@ static int c_ungch[NUNGETCH]; /* array of ungotten chars */
**man-end****************************************************************/
WINDOW *pdc_getch_win = NULL;
static WINDOW *_getch_win = NULL;
/* _breakout() - Check if input is pending, either directly from the
keyboard, or previously buffered. */
@@ -131,11 +131,8 @@ static int _rawgetch(void)
{
int c;
if (pdc_getch_win == (WINDOW *)NULL)
return -1;
if ((SP->delaytenths || pdc_getch_win->_delayms ||
pdc_getch_win->_nodelay) && !_breakout())
if ((SP->delaytenths || _getch_win->_delayms ||
_getch_win->_nodelay) && !_breakout())
return -1;
for (;;)
@@ -144,7 +141,7 @@ static int _rawgetch(void)
/* return the key if it is not a special key */
if ((c = PDC_validchar(c)) >= 0)
if ((unsigned int)c < 256 || _getch_win->_use_keypad)
return c;
}
}
@@ -186,7 +183,7 @@ int wgetch(WINDOW *win)
if (!(win->_flags & _PAD) && is_wintouched(win))
wrefresh(win);
pdc_getch_win = win;
_getch_win = win;
/* if ungotten char exists, remove and return it */

View File

@@ -13,7 +13,7 @@
#include "pdcwin.h"
RCSID("$Id: pdckbd.c,v 1.68 2006/10/21 19:39:51 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.69 2006/10/24 00:12:32 wmcbrine Exp $");
#define ACTUAL_MOUSE_MOVED (actual_mouse_status.changes & 8)
#define ACTUAL_BUTTON_STATUS(x) (actual_mouse_status.button[(x) - 1])
@@ -757,46 +757,6 @@ int PDC_set_ctrl_break(bool setting)
return OK;
}
/*man-start**************************************************************
PDC_validchar() - validate/translate passed character
PDCurses Description:
This is a private PDCurses function.
Checks that 'c' is a valid character, and if so returns it,
with function key translation applied if 'w' has keypad mode
set. If char is invalid, returns -1.
PDCurses Return Value:
This function returns -1 if the passed character is invalid, or
the WINDOW *pdc_getch_win is NULL, or pdc_getch_win's keypad is
not active.
Otherwise, this function returns the PDCurses equivalent of the
passed character. See the function key and key macros in
<curses.h>.
Portability:
PDCurses int PDC_validchar(int c);
**man-end****************************************************************/
int PDC_validchar(int c)
{
PDC_LOG(("PDC_validchar() - called\n"));
/* skip special keys if !keypad mode */
if ((pdc_getch_win == (WINDOW *)NULL) ||
((unsigned int)c >= 256 && !pdc_getch_win->_use_keypad))
c = -1;
PDC_LOG(("PDC_validchar() - returned: %x\n", c));
return c;
}
/* _get_interesting_event returns 0 if *ip doesn't contain an event which
should be passed back to the user. This function filters "useless"
events.

View File

@@ -13,7 +13,7 @@
#include "pdcx11.h"
RCSID("$Id: pdckbd.c,v 1.42 2006/10/15 02:42:26 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.43 2006/10/24 00:12:32 wmcbrine Exp $");
#define TRAPPED_MOUSE_X_POS (pdc_mouse_status.x)
#define TRAPPED_MOUSE_Y_POS (pdc_mouse_status.y)
@@ -198,46 +198,6 @@ int PDC_set_ctrl_break(bool setting)
return OK;
}
/*man-start**************************************************************
PDC_validchar() - validate/translate passed character
PDCurses Description:
This is a private PDCurses function.
Checks that 'c' is a valid character, and if so returns it,
with function key translation applied if 'w' has keypad mode
set. If char is invalid, returns -1.
PDCurses Return Value:
This function returns -1 if the passed character is invalid, or
the WINDOW *pdc_getch_win is NULL, or pdc_getch_win's keypad is
not active.
Otherwise, this function returns the PDCurses equivalent of the
passed character. See the function key and key macros in
<curses.h>.
Portability:
PDCurses int PDC_validchar(int c);
**man-end****************************************************************/
int PDC_validchar(int c)
{
PDC_LOG(("PDC_validchar() - called\n"));
/* skip special keys if !keypad mode */
if ((pdc_getch_win == (WINDOW *)NULL) ||
((unsigned int)c >= 256 && !pdc_getch_win->_use_keypad))
c = -1;
PDC_LOG(("PDC_validchar() - returned: %x\n", c));
return c;
}
/*man-start**************************************************************
PDC_flushinp() - Low-level input flush