From e69bfe74d7f887fb516f300f575d43b9903d9ab3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 23 Mar 2002 02:34:07 +0000 Subject: DOS/Mesa driver updates (Daniel Borca) --- src/glut/dos/PC_HW/pc_keyb.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/glut/dos/PC_HW/pc_keyb.c') diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index f5f4bd8e76..d3987d8e34 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v0.4 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -32,7 +32,7 @@ static volatile struct { static volatile int key_enhanced, key_pause_loop, key_shifts; static int leds_ok = TRUE; static int in_a_terrupt = FALSE; -volatile char pc_key[KEY_MAX]; +static volatile char pc_key[KEY_MAX]; @@ -400,6 +400,10 @@ static int keyboard () } if (((temp==0x4F)||(temp==0x53))&&(key_shifts&KB_CTRL_FLAG)&&(key_shifts&KB_ALT_FLAG)) { + /* Hack alert: + only SIGINT (but not Ctrl-Break) + calls the destructors and will safely clean up + */ __asm__("\n\ movb $0x79, %%al \n\ call ___djgpp_hw_exception \n\ @@ -436,6 +440,11 @@ int pc_readkey (void) } } +int pc_keydown (int code) +{ + return pc_key[code]; +} + void pc_remove_keyb (void) { if (keyboard_installed) { -- cgit v1.2.3