Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2009, 8:41:44 PM (14 years ago)
Author:
scheusso
Message:

a small fix in IOConsole
some changes in GUI-system and preparation for keybindings menu
fix in menu handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/input/KeyBinder.cc

    r6155 r6214  
    254254        // Parse bindings and create the ConfigValueContainers if necessary
    255255        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
     256        {
    256257            it->second->readConfigValue(this->configFile_);
     258            this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_;
     259        }
    257260
    258261        COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
     
    269272                it->second->configContainer_->set(binding);
    270273            it->second->configContainer_->getValue(&(it->second->bindingString_), it->second);
     274            this->allCommands_[it->second->bindingString_] = it->second->groupName_ + " " + it->second->name_;
    271275            return true;
    272276        }
     
    276280            return false;
    277281        }
     282    }
     283   
     284    /**
     285    @brief
     286        Return the key name for a specific command
     287    */
     288    std::string KeyBinder::getBinding(std::string commandName)
     289    {
     290        COUT(0)<< commandName << endl;
     291        if( this->allCommands_.find(commandName) != this->allCommands_.end())
     292        {
     293            std::string keyname = this->allCommands_[commandName];
     294//             while(keyname.find(".")!=keyname.npos)
     295//                 keyname.replace(1, keyname.find("."), " ");
     296            COUT(0) << keyname << endl;
     297            return keyname;
     298        }
     299        else
     300            return "";
    278301    }
    279302
Note: See TracChangeset for help on using the changeset viewer.