Skip to content

Commit

Permalink
Input|Fixed: Clear the key repeaters when reseting the keyboard device
Browse files Browse the repository at this point in the history
Not clearing the key repeaters when reseting the keyboard device
was the cause of the strange/stuck alt key behavior on Windows.
Despite focus being lost the repeaters would continue generating
events, resulting in the DDKEY_RALT state being set to is-down.
  • Loading branch information
danij-deng committed Apr 29, 2012
1 parent eeceb56 commit 25b6a03
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions doomsday/engine/portable/src/dd_input.c
Expand Up @@ -355,11 +355,6 @@ void I_DeviceReset(uint ident)

DEBUG_Message(("I_DeviceReset: %s.\n", Str_Text(I_DeviceNameStr(ident))));

if(ident == IDEV_KEYBOARD)
{
altDown = shiftDown = false;
}

for(k = 0; k < (int)dev->numKeys && dev->keys; ++k)
{
if(dev->keys[k].isDown)
Expand All @@ -382,6 +377,12 @@ void I_DeviceReset(uint ident)
dev->axes[k].position = 0;
}
}

if(ident == IDEV_KEYBOARD)
{
altDown = shiftDown = false;
DD_ClearKeyRepeaters();
}
}

void I_ResetAllDevices(void)
Expand Down

0 comments on commit 25b6a03

Please sign in to comment.