HatchitGame
ht_sdlkeyboard.h
1 
15 #pragma once
16 
17 #include <ht_platform.h>
18 #include <ht_keyboard.h>
19 #include <ht_sdl.h>
20 #include <map>
21 
22 namespace Hatchit
23 {
24  namespace Game
25  {
26  class HT_API SDLKeyboard : public IKeyboard
27  {
28  typedef std::map<SDL_Scancode, bool> KeyState;
29  public:
30  SDLKeyboard();
31 
32  void RegisterKeyDown(SDL_Scancode code);
33  void RegisterKeyUp(SDL_Scancode code);
34 
35 
36  bool VKeyPress(IKeyboard::Key k) override;
37  bool VKeyRelease(IKeyboard::Key k) override;
38  bool VSingleKeyPress(IKeyboard::Key k) override;
39  void VUpdate() override;
40 
41  private:
42  KeyState m_current;
43  KeyState m_previous;
44 
45  SDL_Scancode ConvertFromKey(IKeyboard::Key k);
46  };
47  }
48 }
Definition: ht_sdlkeyboard.h:26
Definition: ht_keyboard.h:23
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_glfwkeyboard.h:21