summaryrefslogtreecommitdiffstats
path: root/src/ui/key.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-10-07 00:46:46 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-10-07 00:46:46 +0200
commit97f44035f1b3ebd2681236c23f14c4d3ea7f09ac (patch)
tree6937ba54a2e43d5e42fcb1cb2950684b4ab3c3ac /src/ui/key.h
parent70dae8796e96b309d95f220dfb083ed81261ceb6 (diff)
downloadcolobot-97f44035f1b3ebd2681236c23f14c4d3ea7f09ac.tar.gz
colobot-97f44035f1b3ebd2681236c23f14c4d3ea7f09ac.tar.bz2
colobot-97f44035f1b3ebd2681236c23f14c4d3ea7f09ac.zip
Changing and saving input bindings
Diffstat (limited to 'src/ui/key.h')
-rw-r--r--src/ui/key.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/ui/key.h b/src/ui/key.h
index 1943f61..2332c9b 100644
--- a/src/ui/key.h
+++ b/src/ui/key.h
@@ -15,13 +15,13 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-// key.h
+/**
+ * \file ui/key.h
+ * \brief Key slot control
+ */
#pragma once
-#include <cctype>
-#include <string>
-
#include "ui/control.h"
#include "common/iman.h"
@@ -29,33 +29,40 @@
#include "common/restext.h"
#include "common/key.h"
-#include "app/app.h"
namespace Ui {
class CKey : public CControl
{
- public:
- CKey();
- virtual ~CKey();
+public:
+ CKey();
+ virtual ~CKey();
- bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventMsg);
- bool EventProcess(const Event &event);
+ //! Creates a new key slot button
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventMsg);
+ //! Management of an event
+ bool EventProcess(const Event &event);
- void Draw();
+ //! Draws button
+ void Draw();
- void SetKey(int option, int key);
- int GetKey(int option);
+ //! Management of binding
+ //@{
+ void SetBinding(InputBinding b);
+ InputBinding GetBinding();
+ //@}
- protected:
- bool TestKey(int key);
+protected:
+ //! Checks if a key is already used
+ bool TestKey(unsigned int key);
- unsigned int m_key[2];
- bool m_bCatch;
+protected:
+ CRobotMain* m_robotMain;
- CApplication *m_app;
+ InputBinding m_binding;
+ bool m_catch;
};
-}
+} // namespace Ui