More like this, I think. I'm still not completely happy with it,

especially since it only works with OS/2 and DJGPP. But it makes more
sense than how it worked before.
This commit is contained in:
William McBrine
2007-01-08 02:52:33 +00:00
parent 3ba375f788
commit c49304d388
4 changed files with 20 additions and 33 deletions

View File

@@ -25,9 +25,10 @@
#ifdef __DJGPP__
# include <fcntl.h>
# include <io.h>
# include <signal.h>
#endif
RCSID("$Id: pdckbd.c,v 1.78 2007/01/07 21:31:17 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.79 2007/01/08 02:52:32 wmcbrine Exp $");
/*man-start**************************************************************
@@ -124,6 +125,7 @@ void PDC_set_keyboard_binary(bool on)
#ifdef __DJGPP__
setmode(fileno(stdin), on ? O_BINARY : O_TEXT);
signal(SIGINT, on ? SIG_IGN : SIG_DFL);
#endif
}

View File

@@ -11,6 +11,12 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
#if defined(__EMX__) || defined(__WATCOMC__) || defined(__IBMC__) || \
defined(__TURBOC__)
# define HAVE_SIGNAL
# include <signal.h>
#endif
#include "pdcos2.h"
#ifdef EMXVIDEO
@@ -25,7 +31,7 @@ static bool key_pressed = FALSE;
static int mouse_events = 0;
#endif
RCSID("$Id: pdckbd.c,v 1.79 2007/01/07 21:31:17 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.80 2007/01/08 02:52:33 wmcbrine Exp $");
/*man-start**************************************************************
@@ -107,24 +113,12 @@ unsigned long PDC_get_input_fd(void)
void PDC_get_keyboard_info(void)
{
PDC_LOG(("PDC_get_keyboard_info() - called\n"));
kbdinfo.cb = sizeof(kbdinfo);
KbdGetStatus(&kbdinfo, 0);
PDC_LOG(("PDC_get_keyboard_info(). cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
}
void PDC_set_keyboard_default(void)
{
PDC_LOG(("PDC_set_keyboard_default(). cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
KbdSetStatus(&kbdinfo, 0);
}
@@ -135,11 +129,6 @@ void PDC_set_keyboard_binary(bool on)
PDC_LOG(("PDC_set_keyboard_binary() - called\n"));
#ifndef EMXVIDEO
PDC_LOG(("PDC_set_keyboard_binary() - before. cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
if (on)
{
kbdinfo.fsMask &= ~(KEYBOARD_ASCII_MODE);
@@ -152,11 +141,10 @@ void PDC_set_keyboard_binary(bool on)
}
KbdSetStatus(&kbdinfo, 0);
#endif
PDC_LOG(("PDC_set_keyboard_binary() - after. cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
#ifdef HAVE_SIGNAL
signal(SIGBREAK, on ? SIG_IGN : SIG_DFL);
#endif
}

View File

@@ -13,7 +13,7 @@
#include "pdcos2.h"
RCSID("$Id: pdcscrn.c,v 1.68 2007/01/07 21:43:14 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.69 2007/01/08 02:52:33 wmcbrine Exp $");
int pdc_font; /* default font size */
@@ -46,9 +46,6 @@ static VIOMODEINFO saved_scrnmode[3];
static int saved_font[3];
static bool can_change = FALSE;
extern void PDC_get_keyboard_info(void);
extern void PDC_set_keyboard_default(void);
static int _get_font(void)
{
VIOMODEINFO modeInfo = {0};

View File

@@ -13,11 +13,11 @@
#include <curspriv.h>
RCSID("$Id: deprec.c,v 1.1 2007/01/07 22:20:06 wmcbrine Exp $");
RCSID("$Id: deprec.c,v 1.2 2007/01/08 02:52:33 wmcbrine Exp $");
/* Deprecated functions. These should not be used, and will be removed
in the future. They're here solely for the benefit of certain
applications that linked to them in older versions of PDCurses. */
/* Deprecated functions. These should not be used, and will eventually
be removed. They're here solely for the benefit of applications that
linked to them in older versions of PDCurses. */
bool PDC_check_bios_key(void)
{
@@ -31,10 +31,10 @@ int PDC_get_bios_key(void)
bool PDC_get_ctrl_break(void)
{
return FALSE;
return !SP->raw_inp;
}
int PDC_set_ctrl_break(bool setting)
{
return OK;
return setting ? noraw() : raw();
}