|
@@ -57,7 +57,8 @@ int ConvertSDLKeyCode(int keySym, int scanCode)
|
|
|
{
|
|
{
|
|
|
if (scanCode == SDL_SCANCODE_AC_BACK)
|
|
if (scanCode == SDL_SCANCODE_AC_BACK)
|
|
|
return KEY_ESC;
|
|
return KEY_ESC;
|
|
|
- else return SDL_toupper(keySym);
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ return SDL_toupper(keySym);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
OBJECTTYPESTATIC(Input);
|
|
OBJECTTYPESTATIC(Input);
|
|
@@ -157,17 +158,20 @@ void Input::Update()
|
|
|
IntVector2 mousePos = GetCursorPosition();
|
|
IntVector2 mousePos = GetCursorPosition();
|
|
|
mouseMove_ = mousePos - lastCursorPosition_;
|
|
mouseMove_ = mousePos - lastCursorPosition_;
|
|
|
|
|
|
|
|
- // Recenter the mouse cursor manually
|
|
|
|
|
- IntVector2 center(graphics_->GetWidth() / 2, graphics_->GetHeight() / 2);
|
|
|
|
|
- SetCursorPosition(center);
|
|
|
|
|
- lastCursorPosition_ = center;
|
|
|
|
|
-
|
|
|
|
|
if (mouseMove_ != IntVector2::ZERO && suppressNextMouseMove_)
|
|
if (mouseMove_ != IntVector2::ZERO && suppressNextMouseMove_)
|
|
|
{
|
|
{
|
|
|
mouseMove_ = IntVector2::ZERO;
|
|
mouseMove_ = IntVector2::ZERO;
|
|
|
suppressNextMouseMove_ = false;
|
|
suppressNextMouseMove_ = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (!suppressNextMouseMove_)
|
|
|
|
|
+ {
|
|
|
|
|
+ // Recenter the mouse cursor manually
|
|
|
|
|
+ IntVector2 center(graphics_->GetWidth() / 2, graphics_->GetHeight() / 2);
|
|
|
|
|
+ SetCursorPosition(center);
|
|
|
|
|
+ lastCursorPosition_ = center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (mouseMove_ != IntVector2::ZERO)
|
|
if (mouseMove_ != IntVector2::ZERO)
|
|
|
{
|
|
{
|
|
|
using namespace MouseMove;
|
|
using namespace MouseMove;
|