Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2008, 7:49:26 PM (16 years ago)
Author:
rgrieder
Message:

merged input branch into gui test branch (was about time)
svn save (it's still a mess and CMLs haven't been updated)
I'll have to create a special project to create the tolua_bind files for tolua itself anyway..

Location:
code/branches/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui

  • code/branches/gui/src/core/input/KeyDetector.cc

    r1535 r1638  
    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        clearBindings();
     71        setConfigValues();
     72        this->command_ = command;
     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.