// SuperTux
// Copyright (C) 2006 Matthias Braun <matze@braunis.de>,
-// 2007-2014 Ingo Ruhnke <grumbel@gmx.de>
+// 2007-2014 Ingo Ruhnke <grumbel@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
#include "util/reader_fwd.hpp"
#include "util/writer_fwd.hpp"
-class JoystickKeyboardController;
+class InputManager;
+class KeyboardConfig;
class KeyboardManager final
{
private:
- friend class KeyboardMenu;
- typedef std::map<SDL_Keycode, Controller::Control> KeyMap;
+ InputManager* m_parent;
+ KeyboardConfig& m_keyboard_config;
public:
- KeyboardManager(JoystickKeyboardController* parent);
+ int wait_for_key;
+
+public:
+ KeyboardManager(InputManager* parent, KeyboardConfig& keyboard_config);
~KeyboardManager();
void process_key_event(const SDL_KeyboardEvent& event);
void process_console_key_event(const SDL_KeyboardEvent& event);
void process_menu_key_event(const SDL_KeyboardEvent& event);
- SDL_Keycode reversemap_key(Controller::Control c);
- void bind_key(SDL_Keycode key, Controller::Control c);
-
- void read(const lisp::Lisp* keymap_lisp);
- void write(Writer& writer);
-
-private:
- JoystickKeyboardController* m_parent;
- KeyMap keymap;
- bool jump_with_up_kbd;
- int wait_for_key;
-
private:
KeyboardManager(const KeyboardManager&) = delete;
KeyboardManager& operator=(const KeyboardManager&) = delete;