Permalink
Browse files

Merge pull request #307 from jhsrennie/master

Improve handling of mouse input that is mapped to a non-mouse action
  • Loading branch information...
2 parents d7ea9a0 + 3fb34be commit 93b329ce7f723a5d8cd860eba17cd01c4dc47761 John Rennie committed Jul 27, 2011
Showing with 17 additions and 13 deletions.
  1. +17 −13 xbmc/Application.cpp
View
@@ -2764,20 +2764,24 @@ bool CApplication::ProcessMouse()
return false;
}
- // Process the appcommand
- CAction newmouseaction = CAction(mouseaction.GetID(),
- g_Mouse.GetHold(MOUSE_LEFT_BUTTON),
- (float)g_Mouse.GetX(),
- (float)g_Mouse.GetY(),
- (float)g_Mouse.GetDX(),
- (float)g_Mouse.GetDY(),
- mouseaction.GetName());
-
// Log mouse actions except for move and noop
- if (newmouseaction.GetID() != ACTION_MOUSE_MOVE && newmouseaction.GetID() != ACTION_NOOP)
- CLog::Log(LOGDEBUG, "%s: trying mouse action %s", __FUNCTION__, newmouseaction.GetName().c_str());
-
- return OnAction(newmouseaction);
+ if (mouseaction.GetID() != ACTION_MOUSE_MOVE && mouseaction.GetID() != ACTION_NOOP)
+ CLog::Log(LOGDEBUG, "%s: trying mouse action %s", __FUNCTION__, mouseaction.GetName().c_str());
+
+ // The action might not be a mouse action. For example wheel moves might
+ // be mapped to volume up/down in mouse.xml. In this case we do not want
+ // the mouse position saved in the action.
+ if (!mouseaction.IsMouse())
+ return OnAction(mouseaction);
+
+ // This is a mouse action so we need to record the mouse position
+ return OnAction(CAction(mouseaction.GetID(),
+ g_Mouse.GetHold(MOUSE_LEFT_BUTTON),
+ (float)g_Mouse.GetX(),
+ (float)g_Mouse.GetY(),
+ (float)g_Mouse.GetDX(),
+ (float)g_Mouse.GetDY(),
+ mouseaction.GetName()));
}
void CApplication::CheckForTitleChange()

0 comments on commit 93b329c

Please sign in to comment.