Example #1
0
void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData)
{
    CBinds *pBinds = (CBinds *)pUserData;
    const char *pKeyName = pResult->GetString(0);
    std::pair<unsigned, unsigned> KeyComb = KeyCombByName(pKeyName);
    unsigned id = KeyComb.first, keymods = KeyComb.second;

    if(!id)
    {
        char aBuf[256];
        str_format(aBuf, sizeof(aBuf), "key %s not found", pKeyName);
        pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf);
        return;
    }

    if(!keymods && pKeyName[0] != '+')
        pBinds->Bind(id, "");
    else
        pBinds->Bind(id, keymods, "");
}
Example #2
0
void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData)
{
	CBinds *pBinds = (CBinds *)pUserData;
	const char *pKeyName = pResult->GetString(0);
	int id = pBinds->GetKeyId(pKeyName);
	
	if(!id)
	{
		dbg_msg("binds", "key %s not found", pKeyName);
		return;
	}
	
	pBinds->Bind(id, "");
}
Example #3
0
void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData)
{
	CBinds *pBinds = (CBinds *)pUserData;
	const char *pKeyName = pResult->GetString(0);
	int id = pBinds->GetKeyID(pKeyName);

	if(!id)
	{
		char aBuf[256];
		str_format(aBuf, sizeof(aBuf), "key %s not found", pKeyName);
		pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf);
		return;
	}

	pBinds->Bind(id, "");
}