Better mouse input handling

This commit is contained in:
Paul Chote
2010-07-12 19:47:51 +12:00
parent bd096436d9
commit e23ee6d892
9 changed files with 126 additions and 139 deletions

View File

@@ -71,10 +71,10 @@ namespace OpenRA
public int2 lastMousePos;
public bool HandleInput(World world, MouseInput mi)
{
if (selectedWidget != null && selectedWidget.HandleInput(mi))
if (selectedWidget != null && selectedWidget.HandleMouseInputOuter(mi))
return true;
if (rootWidget.HandleInput(mi))
if (rootWidget.HandleMouseInputOuter(mi))
return true;
if (mi.Event == MouseInputEvent.Move)
@@ -89,9 +89,9 @@ namespace OpenRA
public bool HandleKeyPress(System.Windows.Forms.KeyPressEventArgs e, Modifiers modifiers)
{
if (selectedWidget != null)
return selectedWidget.HandleKeyPress(e, modifiers);
return selectedWidget.HandleKeyPressOuter(e, modifiers);
if (rootWidget.HandleKeyPress(e, modifiers))
if (rootWidget.HandleKeyPressOuter(e, modifiers))
return true;
return false;
}