From e9de6633881dcd5e781920219e4fd15beda4a8a7 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Thu, 13 Jun 2013 20:42:11 +0000 Subject: [PATCH] Keyboard --- include/Utils/Console/Console.h | 1 + src/GUIManager/KeyboardWidget.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/Utils/Console/Console.h b/include/Utils/Console/Console.h index 4f75b83..7af4f22 100644 --- a/include/Utils/Console/Console.h +++ b/include/Utils/Console/Console.h @@ -11,6 +11,7 @@ Use global variable Console like that: #include #include +#include #ifdef TARGET_WIN32 #include diff --git a/src/GUIManager/KeyboardWidget.cpp b/src/GUIManager/KeyboardWidget.cpp index 5114006..dd30c60 100644 --- a/src/GUIManager/KeyboardWidget.cpp +++ b/src/GUIManager/KeyboardWidget.cpp @@ -131,6 +131,8 @@ namespace SE bool TKeyboardWidget::CheckClick(vec2 mousePos) { + mousePos -= LeftBottomPos; + return (mousePos.v[0] >= 0.f && mousePos.v[1] >= 0.f && mousePos.v[0] <= 320.f && mousePos.v[1] <= 216.f); } @@ -140,6 +142,8 @@ namespace SE void TKeyboardWidget::OnTapUp(vec2 pos) { + pos -= LeftBottomPos; + BOOST_FOREACH(auto& visualKeyElement, VisualKeyArr) { if (std::get<0>(visualKeyElement).CheckClicked(ivec2(pos.v[0], pos.v[1])))