From a5470d5ea068dacf60713c4c779566294f36985d Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 6 Sep 2016 18:43:37 +0200 Subject: [PATCH] really clear all binds during "resetbinds" including self-assigned ones _resetallbinds Clears _all_ binds for all keys and all modes. Do not use the command manually. DOCREF _resetallbinds --- config/resetbinds.cfg | 1 + source/src/console.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config/resetbinds.cfg b/config/resetbinds.cfg index 47fb5d1d..f1af38b5 100644 --- a/config/resetbinds.cfg +++ b/config/resetbinds.cfg @@ -65,6 +65,7 @@ alias editkey_tagclip_plclip [ edittagclip plclip ] alias editkey_tagclip_clip [ edittagclip clip ] _defaultbinds 1 // do not save the following binds to saved.cfg +_resetallbinds bind MOUSE1 attack bind MOUSE2 altaction diff --git a/source/src/console.cpp b/source/src/console.cpp index 5cd13f60..d2124c1c 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -216,6 +216,8 @@ char *keyaction = NULL; VAR(_defaultbinds, 0, 0, 1); +COMMANDF(_resetallbinds, "", () { if(_defaultbinds) loopv(keyms) loopj(keym::NUMACTIONS) bindkey(&keyms[i], "", j); }); + bool bindkey(keym *km, const char *action, int type) { if(!km || type < keym::ACTION_DEFAULT || type >= keym::NUMACTIONS) return false;