X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fkeybinder.c;h=87273b24c653eb5c7c89e2635bce336341f544d9;hb=81e0e6d9c8fa5f317f86e11781201b40a3015d33;hp=01ed3a55375d9ca6503790c3707eb0f1cede091d;hpb=4cdb3a8788bfa8283332dfd5365275f2c20eee09;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/keybinder.c b/qcsrc/menu/xonotic/keybinder.c index 01ed3a553..87273b24c 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_CMD = "// not bound"; + #define MAX_KEYS_PER_FUNCTION 2 #define MAX_KEYBINDS 256 string Xonotic_KeyBinds_Functions[MAX_KEYBINDS]; @@ -130,10 +132,12 @@ 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"); + localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state } void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease) { @@ -191,9 +195,10 @@ 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"); } - + localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state } void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where) {