aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-03 03:16:57 +0200
committerEinar Johan Trøan Sømåen2012-06-03 03:16:57 +0200
commitd79549964c23336dd609702defb9ac740ab971ff (patch)
tree9c7e3026de7fda31b551539172f369188d0b792c /engines/wintermute
parentca1e62035d690ee3a3d16e02d2e75512ef3870b7 (diff)
downloadscummvm-rg350-d79549964c23336dd609702defb9ac740ab971ff.tar.gz
scummvm-rg350-d79549964c23336dd609702defb9ac740ab971ff.tar.bz2
scummvm-rg350-d79549964c23336dd609702defb9ac740ab971ff.zip
WINTERMUTE: Make the engine atleast register keypresses.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/Base/BGame.cpp12
-rw-r--r--engines/wintermute/Base/BObject.cpp2
-rw-r--r--engines/wintermute/Base/BObject.h5
-rw-r--r--engines/wintermute/PlatformSDL.cpp2
-rw-r--r--engines/wintermute/UI/UIWindow.cpp6
-rw-r--r--engines/wintermute/UI/UIWindow.h3
6 files changed, 15 insertions, 15 deletions
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index 3a4e88a612..33bfc8956a 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -3793,22 +3793,22 @@ bool CBGame::HandleKeypress(Common::Event *event) {
_keyboardState->ReadKey(event);
// TODO
-#if 0
+
if (_focusedWindow) {
if (!Game->_focusedWindow->HandleKeypress(event)) {
- if (event->type != SDL_TEXTINPUT) {
+ /*if (event->type != SDL_TEXTINPUT) {*/
if (Game->_focusedWindow->CanHandleEvent("Keypress"))
Game->_focusedWindow->ApplyEvent("Keypress");
else
ApplyEvent("Keypress");
- }
+ /*}*/
}
return true;
- } else if (event->type != SDL_TEXTINPUT) {
+ } else /*if (event->type != SDL_TEXTINPUT)*/ {
ApplyEvent("Keypress");
return true;
- } else return true;
-#endif
+ } //else return true;
+
return false;
}
diff --git a/engines/wintermute/Base/BObject.cpp b/engines/wintermute/Base/BObject.cpp
index 046f31e4ac..9f34541087 100644
--- a/engines/wintermute/Base/BObject.cpp
+++ b/engines/wintermute/Base/BObject.cpp
@@ -960,7 +960,7 @@ HRESULT CBObject::HandleMouse(TMouseEvent Event, TMouseButton Button) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::HandleKeypress(SDL_Event *event) {
+bool CBObject::HandleKeypress(Common::Event *event) {
return false;
}
diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h
index e2c3b25fd8..475325e8e2 100644
--- a/engines/wintermute/Base/BObject.h
+++ b/engines/wintermute/Base/BObject.h
@@ -32,8 +32,7 @@
#include "engines/wintermute/Base/BScriptHolder.h"
#include "engines/wintermute/persistent.h"
-
-union SDL_Event;
+#include "common/events.h"
namespace WinterMute {
@@ -82,7 +81,7 @@ public:
virtual bool HandleMouseWheel(int Delta);
virtual HRESULT HandleMouse(TMouseEvent Event, TMouseButton Button);
- virtual bool HandleKeypress(SDL_Event *event);
+ virtual bool HandleKeypress(Common::Event *event);
virtual int GetHeight();
HRESULT SetCursor(const char *Filename);
HRESULT SetActiveCursor(const char *Filename);
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp
index 909ecb525e..934670a628 100644
--- a/engines/wintermute/PlatformSDL.cpp
+++ b/engines/wintermute/PlatformSDL.cpp
@@ -244,6 +244,8 @@ void CBPlatform::HandleEvent(Common::Event *event) {
case Common::EVENT_MBUTTONUP:
if (Game) Game->OnMouseMiddleUp();
break;
+ case Common::EVENT_KEYDOWN:
+ if (Game) Game->HandleKeypress(event);
/*#ifdef __IPHONEOS__
{
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp
index d364b27740..53ce72fe4a 100644
--- a/engines/wintermute/UI/UIWindow.cpp
+++ b/engines/wintermute/UI/UIWindow.cpp
@@ -1100,16 +1100,14 @@ const char *CUIWindow::ScToString() {
//////////////////////////////////////////////////////////////////////////
-bool CUIWindow::HandleKeypress(SDL_Event *event) {
+bool CUIWindow::HandleKeypress(Common::Event *event) {
//TODO
-#if 0
- if (event->type == SDL_KEYDOWN && event->key.keysym.scancode == SDL_SCANCODE_TAB) {
+ if (event->type == Common::EVENT_KEYDOWN && event->kbd.keycode == Common::KEYCODE_TAB) {
return SUCCEEDED(MoveFocus(!CBKeyboardState::IsShiftDown()));
} else {
if (_focusedWidget) return _focusedWidget->HandleKeypress(event);
else return false;
}
-#endif
return false;
}
diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h
index 510fc076b4..4bdef647a3 100644
--- a/engines/wintermute/UI/UIWindow.h
+++ b/engines/wintermute/UI/UIWindow.h
@@ -31,6 +31,7 @@
#include "UIObject.h"
+#include "common/events.h"
namespace WinterMute {
@@ -69,7 +70,7 @@ public:
virtual HRESULT Display(int OffsetX = 0, int OffsetY = 0);
CUIWindow(CBGame *inGame);
virtual ~CUIWindow();
- virtual bool HandleKeypress(SDL_Event *event);
+ virtual bool HandleKeypress(Common::Event *event);
CBArray<CUIObject *, CUIObject *> _widgets;
TTextAlign _titleAlign;
HRESULT LoadFile(const char *Filename);