Windows: Make layout switch duplicate guard bidirectional.

git-svn-id: https://svn.eduke32.com/eduke32@5971 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-12-26 06:02:49 +00:00
parent d0611405e9
commit fefd94d8ef

View file

@ -281,21 +281,21 @@ void Win_GetOriginalLayoutName(void)
void Win_SetKeyboardLayoutUS(int const toggle) void Win_SetKeyboardLayoutUS(int const toggle)
{ {
if (toggle) static int currentstate;
{
static int done = 0;
if (!done) if (toggle != currentstate)
{
if (toggle)
{ {
// 00000409 is "American English" // 00000409 is "American English"
switchlayout("00000409"); switchlayout("00000409");
currentstate = toggle;
done = 1; }
else if (OriginalLayoutName[0])
{
switchlayout(OriginalLayoutName);
currentstate = toggle;
} }
}
else if (OriginalLayoutName[0])
{
switchlayout(OriginalLayoutName);
} }
} }