예제 #1
0
/*
 * Translates a Linux input event into a DirectFB input event.
 */
bool CLinuxInputDevice::TranslateEvent(const struct input_event& levt,
    XBMC_Event& devt)
{
  switch (levt.type)
  {
  case EV_KEY:
    return KeyEvent(levt, devt);

  case EV_REL:
    if (m_bSkipNonKeyEvents)
    {
      CLog::Log(LOGINFO, "read a relative event which will be ignored (device name %s) (file name %s)", m_deviceName, m_fileName.c_str());
      return false;
    }

    return RelEvent(levt, devt);

  case EV_ABS:
    if (m_bSkipNonKeyEvents)
    {
      CLog::Log(LOGINFO, "read an absolute event which will be ignored (device name %s) (file name %s)", m_deviceName, m_fileName.c_str());
      return false;
    }

    return AbsEvent(levt, devt);

  default:
    ;
  }

  return false;
}
예제 #2
0
/*
 * Translates a Linux input event into a DirectFB input event.
 */
bool CLinuxInputDevice::TranslateEvent(const struct input_event& levt,
    XBMC_Event& devt)
{
  if (m_devicePreferredId == LI_DEVICE_MULTITOUCH)
  {
    switch (levt.type)
    {
    case EV_ABS:
      return mtAbsEvent(levt);

    case EV_SYN:
      return mtSynEvent(levt);

    default:
      // Ignore legacy (key) events
      return false;
    }
  }

  switch (levt.type)
  {
  case EV_KEY:
    return KeyEvent(levt, devt);

  case EV_REL:
    if (m_bSkipNonKeyEvents)
    {
      CLog::Log(LOGINFO, "read a relative event which will be ignored (device name %s) (file name %s)", m_deviceName, m_fileName.c_str());
      return false;
    }

    return RelEvent(levt, devt);

  case EV_ABS:
    if (m_bSkipNonKeyEvents)
    {
      CLog::Log(LOGINFO, "read an absolute event which will be ignored (device name %s) (file name %s)", m_deviceName, m_fileName.c_str());
      return false;
    }

    return AbsEvent(levt, devt);

  default:
    ;
  }

  return false;
}