From: Rudolf Polzer Date: Sun, 21 Nov 2010 20:00:13 +0000 (+0100) Subject: key bind editor: allow permanently unbinding keys X-Git-Tag: xonotic-v0.1.0preview~80^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4fe03a4e699812b38955b4e833cd7f55b637291;p=xonotic%2Fxonotic-data.pk3dir.git key bind editor: allow permanently unbinding keys --- diff --git a/qcsrc/menu/xonotic/keybinder.c b/qcsrc/menu/xonotic/keybinder.c index 01ed3a553..da6f5f545 100644 --- a/qcsrc/menu/xonotic/keybinder.c +++ b/qcsrc/menu/xonotic/keybinder.c @@ -33,6 +33,8 @@ void KeyBinder_Bind_Edit(entity btn, entity me); #ifdef IMPLEMENTATION +string KEY_NOT_BOUND_COMMAND "// not bound"; + #define MAX_KEYS_PER_FUNCTION 2 #define MAX_KEYBINDS 256 string Xonotic_KeyBinds_Functions[MAX_KEYBINDS]; @@ -130,7 +132,8 @@ void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii) { k = stof(argv(j)); if(k != -1) - localcmd("\nunbind \"", keynumtostring(k), "\"\n"); + //localcmd("\nunbind \"", keynumtostring(k), "\"\n"); + localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n"); } } localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n"); @@ -191,7 +194,8 @@ void KeyBinder_Bind_Clear(entity btn, entity me) { k = stof(argv(j)); if(k != -1) - localcmd("\nunbind \"", keynumtostring(k), "\"\n"); + //localcmd("\nunbind \"", keynumtostring(k), "\"\n"); + localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n"); } }