mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-24 15:55:14 +00:00
The "bios" part of the names PDC_check_bios_key() and PDC_get_bios_key()
makes sense only in DOS. I've wanted to change it for a while, but hesitated because it was used in some apps... but it shouldn't be.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: curspriv.h,v 1.147 2007/01/05 12:01:22 wmcbrine Exp $ */
|
||||
/* $Id: curspriv.h,v 1.148 2007/01/07 21:31:17 wmcbrine Exp $ */
|
||||
|
||||
/* CURSPRIV.H
|
||||
|
||||
@@ -68,12 +68,12 @@ extern unsigned char *pdc_atrtab;
|
||||
void PDC_beep(void);
|
||||
bool PDC_can_change_color(void);
|
||||
int PDC_color_content(short, short *, short *, short *);
|
||||
bool PDC_check_bios_key(void);
|
||||
bool PDC_check_key(void);
|
||||
int PDC_curs_set(int);
|
||||
void PDC_flushinp(void);
|
||||
int PDC_get_bios_key(void);
|
||||
int PDC_get_columns(void);
|
||||
int PDC_get_cursor_mode(void);
|
||||
int PDC_get_key(void);
|
||||
int PDC_get_rows(void);
|
||||
void PDC_gotoyx(int, int);
|
||||
int PDC_init_color(short, short, short, short);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.77 2007/01/05 12:01:22 wmcbrine Exp $");
|
||||
RCSID("$Id: pdckbd.c,v 1.78 2007/01/07 21:31:17 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -124,18 +124,15 @@ void PDC_set_keyboard_binary(bool on)
|
||||
|
||||
#ifdef __DJGPP__
|
||||
setmode(fileno(stdin), on ? O_BINARY : O_TEXT);
|
||||
setcbrk(!on);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* check if a key or mouse event is waiting */
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
bool PDC_check_key(void)
|
||||
{
|
||||
PDCREGS regs;
|
||||
|
||||
PDC_LOG(("PDC_check_bios_key() - called\n"));
|
||||
|
||||
if (shift_function == 0xff)
|
||||
{
|
||||
int scan;
|
||||
@@ -337,7 +334,7 @@ static int _process_mouse_events(void)
|
||||
|
||||
/* return the next available key or mouse event */
|
||||
|
||||
int PDC_get_bios_key(void)
|
||||
int PDC_get_key(void)
|
||||
{
|
||||
PDCREGS regs;
|
||||
int key, scan;
|
||||
|
||||
@@ -25,7 +25,7 @@ static bool key_pressed = FALSE;
|
||||
static int mouse_events = 0;
|
||||
#endif
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.78 2007/01/05 12:01:22 wmcbrine Exp $");
|
||||
RCSID("$Id: pdckbd.c,v 1.79 2007/01/07 21:31:17 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -162,12 +162,11 @@ void PDC_set_keyboard_binary(bool on)
|
||||
|
||||
/* check if a key or mouse event is waiting */
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
bool PDC_check_key(void)
|
||||
{
|
||||
#if !defined(_MSC_VER) && !defined(EMXVIDEO)
|
||||
KBDKEYINFO keyInfo = {0};
|
||||
#endif
|
||||
PDC_LOG(("PDC_check_bios_key() - called\n"));
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
if (tahead == -1) /* Nothing typed yet */
|
||||
@@ -336,13 +335,12 @@ static int _process_mouse_events(void)
|
||||
|
||||
/* return the next available key or mouse event */
|
||||
|
||||
int PDC_get_bios_key(void)
|
||||
int PDC_get_key(void)
|
||||
{
|
||||
int key, scan;
|
||||
#ifndef EMXVIDEO
|
||||
KBDKEYINFO keyInfo = {0};
|
||||
#endif
|
||||
PDC_LOG(("PDC_get_bios_key() - called\n"));
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
if (tahead == -1)
|
||||
|
||||
@@ -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.62 2006/12/28 09:37:35 wmcbrine Exp $");
|
||||
RCSID("$Id: getch.c,v 1.63 2007/01/07 21:31:17 wmcbrine Exp $");
|
||||
|
||||
static int c_pindex = 0; /* putter index */
|
||||
static int c_gindex = 1; /* getter index */
|
||||
@@ -236,7 +236,7 @@ int wgetch(WINDOW *win)
|
||||
{
|
||||
/* is there a keystroke ready? */
|
||||
|
||||
if (!PDC_check_bios_key())
|
||||
if (!PDC_check_key())
|
||||
{
|
||||
/* if not, handle timeout() and halfdelay() */
|
||||
|
||||
@@ -257,7 +257,7 @@ int wgetch(WINDOW *win)
|
||||
|
||||
/* if there is, fetch it */
|
||||
|
||||
key = PDC_get_bios_key();
|
||||
key = PDC_get_key();
|
||||
|
||||
if (SP->key_code)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.104 2007/01/05 12:01:23 wmcbrine Exp $");
|
||||
RCSID("$Id: pdckbd.c,v 1.105 2007/01/07 21:31:17 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -257,10 +257,8 @@ void PDC_set_keyboard_binary(bool on)
|
||||
|
||||
/* check if a key or mouse event is waiting */
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
bool PDC_check_key(void)
|
||||
{
|
||||
PDC_LOG(("PDC_check_bios_key() - called\n"));
|
||||
|
||||
if (key_count > 0)
|
||||
return TRUE;
|
||||
|
||||
@@ -362,7 +360,7 @@ static int _get_key_count(void)
|
||||
|
||||
/* _process_key_event returns -1 if the key in save_ip should be
|
||||
ignored. Otherwise it returns the keycode which should be returned
|
||||
by PDC_get_bios_key(). save_ip must be a key event.
|
||||
by PDC_get_key(). save_ip must be a key event.
|
||||
|
||||
CTRL-ALT support has been disabled, when is it emitted plainly? */
|
||||
|
||||
@@ -609,10 +607,8 @@ static int _process_mouse_event(void)
|
||||
|
||||
/* return the next available key or mouse event */
|
||||
|
||||
int PDC_get_bios_key(void)
|
||||
int PDC_get_key(void)
|
||||
{
|
||||
PDC_LOG(("PDC_get_bios_key() - called\n"));
|
||||
|
||||
pdc_key_modifiers = 0L;
|
||||
|
||||
if (!key_count)
|
||||
|
||||
24
x11/pdckbd.c
24
x11/pdckbd.c
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "pdcx11.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.56 2007/01/05 12:01:23 wmcbrine Exp $");
|
||||
RCSID("$Id: pdckbd.c,v 1.57 2007/01/07 21:31:17 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -33,13 +33,11 @@ RCSID("$Id: pdckbd.c,v 1.56 2007/01/05 12:01:23 wmcbrine Exp $");
|
||||
|
||||
/* check if a key or mouse event is waiting */
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
bool PDC_check_key(void)
|
||||
{
|
||||
struct timeval socket_timeout = {0};
|
||||
int s;
|
||||
|
||||
XC_LOG(("PDC_check_bios_key() - called\n"));
|
||||
|
||||
/* Is something ready to be read on the socket ? Must be a key. */
|
||||
|
||||
FD_ZERO(&xc_readfds);
|
||||
@@ -48,9 +46,9 @@ bool PDC_check_bios_key(void)
|
||||
if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL,
|
||||
NULL, &socket_timeout)) < 0)
|
||||
XCursesExitCursesProcess(3, "child - exiting from "
|
||||
"PDC_check_bios_key select failed");
|
||||
"PDC_check_key select failed");
|
||||
|
||||
PDC_LOG(("%s:PDC_check_bios_key() - returning %s\n", XCLOGMSG,
|
||||
PDC_LOG(("%s:PDC_check_key() - returning %s\n", XCLOGMSG,
|
||||
s ? "TRUE" : "FALSE"));
|
||||
|
||||
return !!s;
|
||||
@@ -58,15 +56,13 @@ bool PDC_check_bios_key(void)
|
||||
|
||||
/* return the next available key or mouse event */
|
||||
|
||||
int PDC_get_bios_key(void)
|
||||
int PDC_get_key(void)
|
||||
{
|
||||
unsigned long newkey = 0;
|
||||
int key = 0;
|
||||
|
||||
XC_LOG(("PDC_get_bios_key() - called\n"));
|
||||
|
||||
if (XC_read_socket(xc_key_sock, &newkey, sizeof(unsigned long)) < 0)
|
||||
XCursesExitCursesProcess(2, "exiting from PDC_get_bios_key");
|
||||
XCursesExitCursesProcess(2, "exiting from PDC_get_key");
|
||||
|
||||
pdc_key_modifiers = (newkey >> 24) & 0xFF;
|
||||
key = (int)(newkey & 0x00FFFFFF);
|
||||
@@ -76,10 +72,10 @@ int PDC_get_bios_key(void)
|
||||
if (XC_read_socket(xc_key_sock, &pdc_mouse_status,
|
||||
sizeof(MOUSE_STATUS)) < 0)
|
||||
XCursesExitCursesProcess(2,
|
||||
"exiting from PDC_get_bios_key");
|
||||
"exiting from PDC_get_key");
|
||||
}
|
||||
|
||||
PDC_LOG(("%s:PDC_get_bios_key() - key %d returned\n", XCLOGMSG, key));
|
||||
PDC_LOG(("%s:PDC_get_key() - key %d returned\n", XCLOGMSG, key));
|
||||
|
||||
return key;
|
||||
}
|
||||
@@ -103,8 +99,8 @@ void PDC_flushinp(void)
|
||||
{
|
||||
PDC_LOG(("PDC_flushinp() - called\n"));
|
||||
|
||||
while (PDC_check_bios_key())
|
||||
PDC_get_bios_key();
|
||||
while (PDC_check_key())
|
||||
PDC_get_key();
|
||||
}
|
||||
|
||||
int PDC_mouse_set(void)
|
||||
|
||||
Reference in New Issue
Block a user