Skip to content

Commit

Permalink
move the focus on tap to CApplication::OnEvent() rather than being in…
Browse files Browse the repository at this point in the history
… the touch handler
  • Loading branch information
Jonathan Marshall committed Apr 6, 2013
1 parent 823265a commit d68d97c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 13 additions & 0 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,19 @@ bool CApplication::OnEvent(XBMC_Event& newEvent)
case XBMC_TOUCH:
{
int windowId = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;

if (newEvent.touch.action == ACTION_TOUCH_TAP)
{
// Send a mouse motion event for getting the current guiitem selected
XBMC_Event mouseEvent;
memset(&mouseEvent, 0, sizeof(mouseEvent));

mouseEvent.type = XBMC_MOUSEMOTION;
mouseEvent.motion.type = XBMC_MOUSEMOTION;
mouseEvent.motion.x = newEvent.touch.x;
mouseEvent.motion.y = newEvent.touch.y;
OnEvent(mouseEvent);
}
int actionId = 0;
if (newEvent.touch.action == ACTION_GESTURE_BEGIN || newEvent.touch.action == ACTION_GESTURE_END)
{
Expand Down
1 change: 0 additions & 1 deletion xbmc/input/touch/generic/GenericTouchActionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ void CGenericTouchActionHandler::OnTap(float x, float y, int32_t pointers /* = 1
if (pointers <= 0 || pointers > 10)
return;

focusControl(x, y);
sendEvent(ACTION_TOUCH_TAP, (uint16_t)x, (uint16_t)y, 0.0f, 0.0f, pointers);
}

Expand Down

0 comments on commit d68d97c

Please sign in to comment.