本文整理汇总了C++中CAction::IsMouse方法的典型用法代码示例。如果您正苦于以下问题:C++ CAction::IsMouse方法的具体用法?C++ CAction::IsMouse怎么用?C++ CAction::IsMouse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAction
的用法示例。
在下文中一共展示了CAction::IsMouse方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMouse
bool CInputManager::ProcessMouse(int windowId)
{
MEASURE_FUNCTION;
if (!m_Mouse.IsActive() || !g_application.IsAppFocused())
return false;
// Get the mouse command ID
uint32_t mousekey = m_Mouse.GetKey();
if (mousekey == KEY_MOUSE_NOOP)
return true;
// Reset the screensaver and idle timers
g_application.ResetSystemIdleTimer();
g_application.ResetScreenSaver();
if (g_application.WakeUpScreenSaverAndDPMS())
return true;
// Retrieve the corresponding action
CKey key(mousekey, (unsigned int)0);
CAction mouseaction = CButtonTranslator::GetInstance().GetAction(windowId, key);
// Deactivate mouse if non-mouse action
if (!mouseaction.IsMouse())
m_Mouse.SetActive(false);
// Consume ACTION_NOOP.
// Some views or dialogs gets closed after any ACTION and
// a sensitive mouse might cause problems.
if (mouseaction.GetID() == ACTION_NOOP)
return false;
// If we couldn't find an action return false to indicate we have not
// handled this mouse action
if (!mouseaction.GetID())
{
CLog::LogF(LOGDEBUG, "unknown mouse command %d", mousekey);
return false;
}
// Log mouse actions except for move and noop
if (mouseaction.GetID() != ACTION_MOUSE_MOVE && mouseaction.GetID() != ACTION_NOOP)
CLog::LogF(LOGDEBUG, "trying mouse action %s", 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 g_application.OnAction(mouseaction);
// This is a mouse action so we need to record the mouse position
return g_application.OnAction(CAction(mouseaction.GetID(),
m_Mouse.GetHold(MOUSE_LEFT_BUTTON),
(float)m_Mouse.GetX(),
(float)m_Mouse.GetY(),
(float)m_Mouse.GetDX(),
(float)m_Mouse.GetDY(),
mouseaction.GetName()));
}
示例2: OnAction
bool CGUIDialog::OnAction(const CAction &action)
{
// keyboard or controller movement should prevent autoclosing
if (!action.IsMouse() && m_autoClosing)
SetAutoClose(m_showDuration);
return CGUIWindow::OnAction(action);
}
示例3: OnAction
bool CGUIWindow::OnAction(const CAction &action)
{
if (action.IsMouse() || action.IsGesture())
return EVENT_RESULT_UNHANDLED != OnMouseAction(action);
CGUIControl *focusedControl = GetFocusedControl();
if (focusedControl)
{
if (focusedControl->OnAction(action))
return true;
}
else
{
// no control has focus?
// set focus to the default control then
CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), m_defaultControl);
OnMessage(msg);
}
// default implementations
switch(action.GetID())
{
case ACTION_NAV_BACK:
case ACTION_PREVIOUS_MENU:
return OnBack(action.GetID());
case ACTION_SHOW_INFO:
return OnInfo(action.GetID());
case ACTION_MENU:
if (m_menuControlID > 0)
{
CGUIControl *menu = GetControl(m_menuControlID);
if (menu)
{
int focusControlId;
if (!menu->HasFocus())
{
// focus the menu control
focusControlId = m_menuControlID;
// To support a toggle behaviour we store the last focused control id
// to restore (focus) this control if the menu control has the focus
// while you press the menu button again.
m_menuLastFocusedControlID = GetFocusedControlID();
}
else
{
// restore the last focused control or if not exists use the default control
focusControlId = m_menuLastFocusedControlID > 0 ? m_menuLastFocusedControlID : m_defaultControl;
}
CGUIMessage msg = CGUIMessage(GUI_MSG_SETFOCUS, GetID(), focusControlId);
return OnMessage(msg);
}
}
break;
}
return false;
}
示例4: OnAction
bool CGUIDialog::OnAction(const CAction &action)
{
// keyboard or controller movement should prevent autoclosing
if (!action.IsMouse() && m_autoClosing)
SetAutoClose(m_showDuration);
if (action.GetID() == ACTION_CLOSE_DIALOG || action.GetID() == ACTION_PREVIOUS_MENU || action.GetID() == ACTION_PARENT_DIR)
{
Close();
return true;
}
return CGUIWindow::OnAction(action);
}
示例5: OnAction
bool CGUIWindow::OnAction(const CAction &action)
{
if (action.IsMouse() || action.IsGesture())
return EVENT_RESULT_UNHANDLED != OnMouseAction(action);
CGUIControl *focusedControl = GetFocusedControl();
if (focusedControl)
return focusedControl->OnAction(action);
// no control has focus?
// set focus to the default control then
CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), m_defaultControl);
OnMessage(msg);
return false;
}
示例6: OnAction
bool Window::OnAction(const CAction &action)
{
TRACE;
// do the base class window first, and the call to python after this
bool ret = ref(window)->OnAction(action);
// workaround - for scripts which try to access the active control (focused) when there is none.
// for example - the case when the mouse enters the screen.
CGUIControl *pControl = ref(window)->GetFocusedControl();
if (action.IsMouse() && !pControl)
return ret;
AddonClass::Ref<Action> inf(new Action(action));
invokeCallback(new CallbackFunction<Window,AddonClass::Ref<Action> >(this,&Window::onAction,inf.get()));
PulseActionEvent();
return ret;
}
示例7: OnAction
bool CGUIPythonWindow::OnAction(const CAction &action)
{
// do the base class window first, and the call to python after this
bool ret = CGUIWindow::OnAction(action);
// workaround - for scripts which try to access the active control (focused) when there is none.
// for example - the case when the mouse enters the screen.
CGUIControl *pControl = GetFocusedControl();
if (action.IsMouse() && !pControl)
return ret;
if(pCallbackWindow)
{
PyXBMCAction* inf = new PyXBMCAction(pCallbackWindow);
inf->pObject = Action_FromAction(action);
// aquire lock?
PyXBMC_AddPendingCall(m_threadState, Py_XBMC_Event_OnAction, inf);
PulseActionEvent();
}
return ret;
}
示例8: OnAction
bool CGUIWindowStartup::OnAction(const CAction &action)
{
if (action.IsMouse())
return true;
return CGUIWindow::OnAction(action);
}