mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-10 12:01:43 +00:00
keys.c: Allow SetBinding() to really clear a key, instead of binding it to the empty string.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1087 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
5ca58d55b0
commit
0c28e5a03e
2 changed files with 5 additions and 4 deletions
|
@ -612,7 +612,8 @@ void Key_SetBinding (int keynum, const char *binding)
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate memory for new binding
|
// allocate memory for new binding
|
||||||
keybindings[keynum] = Z_Strdup(binding);
|
if (binding)
|
||||||
|
keybindings[keynum] = Z_Strdup(binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -637,7 +638,7 @@ void Key_Unbind_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Key_SetBinding (b, "");
|
Key_SetBinding (b, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Key_Unbindall_f (void)
|
void Key_Unbindall_f (void)
|
||||||
|
@ -647,7 +648,7 @@ void Key_Unbindall_f (void)
|
||||||
for (i = 0; i < MAX_KEYS; i++)
|
for (i = 0; i < MAX_KEYS; i++)
|
||||||
{
|
{
|
||||||
if (keybindings[i])
|
if (keybindings[i])
|
||||||
Key_SetBinding (i, "");
|
Key_SetBinding (i, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1377,7 +1377,7 @@ void M_UnbindCommand (const char *command)
|
||||||
if (!b)
|
if (!b)
|
||||||
continue;
|
continue;
|
||||||
if (!strncmp (b, command, l) )
|
if (!strncmp (b, command, l) )
|
||||||
Key_SetBinding (j, "");
|
Key_SetBinding (j, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue