Blamite Game Engine - blam!  00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
KeyPressEvent.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../events.h"
4 
5 #include <sdl2/SDL_keyboard.h>
6 
7 namespace Blam::Events
8 {
14  class KeyPressEvent : public Event
15  {
16  private:
17  SDL_Keycode key;
18  public:
24  KeyPressEvent(SDL_Keycode _vk)
25  {
26  key = _vk;
28  }
29 
36  {
37  return key;
38  }
39  };
40 }
Blam::Events::Event::event_type
EventType event_type
The type of the event.
Definition: Event.hpp:18
Blam::Events::Event
Class representing a generic event.
Definition: Event.hpp:13
Blam::Events
Namespace for handling things related to Events.
Definition: CharacterInputEvent.hpp:5
Blam::Events::KeyPressEvent::KeyPressEvent
KeyPressEvent(SDL_Keycode _vk)
Constructs a new event.
Definition: KeyPressEvent.hpp:24
Blam::Events::KeyPressEvent::GetVirtualKey
int GetVirtualKey()
Retrieves the virtual key code that was pressed.
Definition: KeyPressEvent.hpp:35
KeyPress
@ KeyPress
Definition: events.h:7
Blam::Events::KeyPressEvent
Class representing a virtual key press.
Definition: KeyPressEvent.hpp:14