ソースを参照

Forgot to check focus

Dan Elkouby 10 年 前
コミット
5a4ac80e28
共有1 個のファイルを変更した2 個の追加1 個の削除を含む
  1. 2 1
      platform/sfml/Quirks.cpp

+ 2 - 1
platform/sfml/Quirks.cpp

@@ -1,4 +1,5 @@
 #include "Quirks.h"
+#include "sfwindow.h"
 
 using namespace WalrusRPG;
 
@@ -12,5 +13,5 @@ void Quirks::deinit()
 
 bool Quirks::get_key(keycode_t key)
 {
-    return sf::Keyboard::isKeyPressed(key);
+    return sf::Keyboard::isKeyPressed(key) && window.hasFocus();
 }