Skip to content

Commit

Permalink
Merge pull request #307 from jhsrennie/master
Browse files Browse the repository at this point in the history
Improve handling of mouse input that is mapped to a non-mouse action
  • Loading branch information
John Rennie committed Jul 27, 2011
2 parents d7ea9a0 + 3fb34be commit 93b329c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 93b329c

Please sign in to comment.