try to fix a debugger usability issue for kujakiller involving stuck keyboard keys when switching between debugger and main emu window with debugger snaps

This commit is contained in:
zeromus 2008-08-17 07:55:33 +00:00
parent 689c700b0c
commit 8da54eff69
1 changed files with 47 additions and 48 deletions

View File

@ -53,7 +53,16 @@ void KeyboardUpdateState(void)
switch(ddrval)
{
case DI_OK: //memcpy(keys,tk,256);break;
{
break;
case DIERR_INPUTLOST:
case DIERR_NOTACQUIRED:
memset(tk,0,256);
IDirectInputDevice7_Acquire(lpdid);
break;
}
//process keys
extern int soundoptions;
#define SO_OLDUP 32
@ -100,16 +109,6 @@ void KeyboardUpdateState(void)
for(int i = 0 ; i < 256 ; i++)
if((int)keys[i] >= KEY_REPEAT_INITIAL_DELAY && !(keys[i]%KEY_REPEAT_REPEATING_DELAY))
keys[i] = 0;
}
break;
case DIERR_INPUTLOST:
case DIERR_NOTACQUIRED:
memset(keys,0,256);
IDirectInputDevice7_Acquire(lpdid);
break;
}
extern uint8 autoHoldOn, autoHoldReset;
autoHoldOn = autoHoldKey && keys[autoHoldKey] != 0;