Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2008, 1:37:36 AM (16 years ago)
Author:
rgrieder
Message:

merged gui back to trunk.
update the media repository!

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/input/KeyDetector.cc

    r1747 r1755  
    2828
    2929/**
    30  @file
    31  @brief Implementation of the different input handlers.
    32  */
     30@file
     31@brief
     32    Implementation of the different input handlers.
     33*/
    3334
    3435#include "KeyDetector.h"
     
    4243namespace orxonox
    4344{
    44   /**
    45     @brief Constructor
    46   */
    47   KeyDetector::KeyDetector()
    48   {
    49     RegisterObject(KeyDetector);
    50   }
     45    /**
     46    @brief
     47        Constructor
     48    */
     49    KeyDetector::KeyDetector()
     50    {
     51        RegisterObject(KeyDetector);
     52    }
    5153
    52   /**
    53     @brief Destructor
    54   */
    55   KeyDetector::~KeyDetector()
    56   {
    57   }
     54    /**
     55    @brief
     56        Destructor
     57    */
     58    KeyDetector::~KeyDetector()
     59    {
     60    }
    5861
    59   /**
    60     @brief Loads the key and button bindings.
    61     @return True if loading succeeded.
    62   */
    63   void KeyDetector::loadBindings()
    64   {
    65     clearBindings();
    66     setConfigValues();
    67   }
     62    /**
     63    @brief
     64        Loads the key and button bindings.
     65    @return
     66        True if loading succeeded.
     67    */
     68    void KeyDetector::loadBindings(const std::string& command)
     69    {
     70        this->command_ = command;
     71        clearBindings();
     72        setConfigValues();
     73    }
    6874
    69   void KeyDetector::readTrigger(Button& button)
    70   {
    71     SimpleCommand* cmd = new SimpleCommand();
    72     cmd->evaluation_ = CommandExecutor::evaluate("storeKeyStroke " + button.name_);
    73     button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
    74     button.commands_[KeybindMode::OnPress][0] = cmd;
    75     button.nCommands_[KeybindMode::OnPress] = 1;
    76   }
     75    void KeyDetector::readTrigger(Button& button)
     76    {
     77        SimpleCommand* cmd = new SimpleCommand();
     78        cmd->evaluation_ = CommandExecutor::evaluate(this->command_ + " " + button.name_);
     79        button.commands_[KeybindMode::OnPress] = new BaseCommand*[1];
     80        button.commands_[KeybindMode::OnPress][0] = cmd;
     81        button.nCommands_[KeybindMode::OnPress] = 1;
     82    }
    7783}
Note: See TracChangeset for help on using the changeset viewer.