summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-06-14 18:49:11 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-06-14 18:49:11 +0200
commitbef4a4cebb599aab2704f509e8652ad5da2f84d2 (patch)
tree8b7ee1b6accbafabc5fe470487e96cbb1fdd7de4
parent9a56f664df9478e2caf79a5957a34b39eddc28e2 (diff)
Temporary hack to get UI input working on win32 builds.
-rw-r--r--gui.cpp10
-rw-r--r--scene.cpp9
2 files changed, 19 insertions, 0 deletions
diff --git a/gui.cpp b/gui.cpp
index be6b28f..ecdd7e2 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -110,11 +110,21 @@ bool ConsoleWindow::keydown(const EventArgs& e) {
const KeyEventArgs& ke = static_cast<const KeyEventArgs&>(e);
switch(ke.scancode) {
// enter
+ // TODO: FIX!
+#ifdef WIN32
+ case 28:
+#else
case 36:
+#endif
handle_input();
break;
// backspace
+ // TODO: FIX!
+#ifdef WIN32
+ case 14:
+#else
case 22:
+#endif
erase_editbox_text();
break;
default:
diff --git a/scene.cpp b/scene.cpp
index e981d8b..1fda39e 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -162,7 +162,12 @@ void Scene::events() {
running = false;
break;
case SDL_KEYDOWN:
+ // TODO: FIX!
+#ifdef WIN32
+ if(console->showing() && event.key.keysym.sym != SDLK_BACKQUOTE) {
+#else
if(console->showing() && event.key.keysym.sym != 124) {
+#endif
CEGUI::System::getSingleton().injectKeyDown(event.key.keysym.scancode);
if(CEGUI::System::getSingleton().injectChar(event.key.keysym.unicode))
break;
@@ -213,7 +218,11 @@ void Scene::events() {
tool = new RaiseTool(terrain);
break;
// TODO: change/make configurable
+#ifdef WIN32
+ case SDLK_BACKQUOTE:
+#else
case 124:
+#endif
if(console->showing()) {
console->hide();
dialog = false;