Преглед на файлове

Get key state. For science

Eiyeron Fulmincendii преди 10 години
родител
ревизия
0806f083bc
променени са 3 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 1 0
      platform/include/Input.h
  2. 5 0
      platform/nspire/Input.cpp
  3. 5 0
      platform/sfml/Input.cpp

+ 1 - 0
platform/include/Input.h

@@ -31,6 +31,7 @@ namespace WalrusRPG
 
         void key_poll();
 
+        KeyState key_get_state(Key key);
         bool key_pressed(Key key);
         bool key_released(Key key);
         bool key_down(Key key);

+ 5 - 0
platform/nspire/Input.cpp

@@ -23,6 +23,11 @@ static InputMap key_map[] = {
     {Key::K_START, KEY_NSPIRE_HOME}, {Key::K_SELECT, KEY_NSPIRE_ESC},
 };
 
+KeyState INPUT::key_get_state(Key key)
+{
+        return key_states[key];
+}
+
 void INPUT::key_poll()
 {
     for (unsigned i = 0; i < K_SIZE; i++)

+ 5 - 0
platform/sfml/Input.cpp

@@ -32,6 +32,11 @@ InputMap key_map[] = {
     {Key::K_SELECT, Keyboard::BackSpace, Keyboard::Unknown},
 };
 
+KeyState INPUT::key_get_state(Key key)
+{
+        return key_states[key];
+}
+
 void INPUT::key_poll()
 {
     bool hasFocus = window.hasFocus();