See Lines 9733 to 9735: in emacs: src/w32fns.c
static int isdead = 0;
if (isdead == 2)
This is apparently a mistake. This sort of thing usually happens when refactoring gets screwed up.
Seems to have been there for a long time!? Trying to guess what the original intention might have been here;
9723
/* The return code indicates key code size. cpID is the codepage to
9724
use for translation to Unicode; -1 means use the current console
9725
input codepage. */
9726
int
9727
w32_kbd_patch_key (KEY_EVENT_RECORD *event, int cpId)
9728
{
9729
unsigned int key_code = event->wVirtualKeyCode;
9730
unsigned int mods = event->dwControlKeyState;
9731
BYTE keystate[256];
9732
static BYTE ansi_code[4];
9733
static int isdead = 0;
9735
if (isdead == 2)
9736
{
9737
event->uChar.AsciiChar = ansi_code[2];
9738
isdead = 0;
9739
return 1;
9740
}