From f7a6729a01ce8c07dddf4a7f7c0b25f8690e2c1a Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 9 Jul 2005 13:21:21 +0000 Subject: This should really be two or three different commits, but I'm too lazy for that: * Re-worked the elevator script bug workaround so that it's more consistent with the other two script bug workarounds. * Some renamings to make it more clear that game events and input events are two completely different things. * Added function for clearing pending input events, and used that to fix an annoying keyboard repeat bug when closing the debug console. (The console would keep re-opening because the key press to open it kept repeating even though the key had been released.) svn-id: r18522 --- sword2/console.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sword2/console.cpp') diff --git a/sword2/console.cpp b/sword2/console.cpp index f09d268731..76a96ea7fb 100644 --- a/sword2/console.cpp +++ b/sword2/console.cpp @@ -154,6 +154,7 @@ void Debugger::postEnter() { bool Debugger::Cmd_Exit(int argc, const char **argv) { _detach_now = true; + _vm->clearInputEvents(); return false; } @@ -584,15 +585,15 @@ bool Debugger::Cmd_Var(int argc, const char **argv) { } bool Debugger::Cmd_Rect(int argc, const char **argv) { - uint32 filter = _vm->setEventFilter(0); + uint32 filter = _vm->setInputEventFilter(0); _definingRectangles = !_definingRectangles; if (_definingRectangles) { - _vm->setEventFilter(filter & ~(RD_LEFTBUTTONUP | RD_RIGHTBUTTONUP)); + _vm->setInputEventFilter(filter & ~(RD_LEFTBUTTONUP | RD_RIGHTBUTTONUP)); DebugPrintf("Mouse rectangles enabled\n"); } else { - _vm->setEventFilter(filter | RD_LEFTBUTTONUP | RD_RIGHTBUTTONUP); + _vm->setInputEventFilter(filter | RD_LEFTBUTTONUP | RD_RIGHTBUTTONUP); DebugPrintf("Mouse rectangles disabled\n"); } -- cgit v1.2.3