Ejemplo n.º 1
0
void CLCDOutput::ReadButtons()
{
    if(IsOpened())
    {
        DWORD dwButtonState = 0;
        
        DWORD res = lgLcdReadSoftButtons(m_hDevice, &dwButtonState);
        if (ERROR_SUCCESS != res)
        {
            LCDUITRACE(_T("lgLcdReadSoftButtons failed: unplug?\n"));
            HandleErrorFromAPI(res);
        }
        
        if (m_dwButtonState == dwButtonState)
            return;
        
        // handle the buttons
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON0);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON1);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON2);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON3);
        
        m_dwButtonState = dwButtonState;
    }
}
Ejemplo n.º 2
0
void CLCDOutput::OnSoftButtonEvent(DWORD dwButtonState)
{
    if (LGLCD_DEVICE_FAMILY_QVGA_BASIC == m_pGfx->GetFamily())
    {
        HandleButtonState(dwButtonState, LGLCDBUTTON_LEFT);
        HandleButtonState(dwButtonState, LGLCDBUTTON_RIGHT);
        HandleButtonState(dwButtonState, LGLCDBUTTON_OK);
        HandleButtonState(dwButtonState, LGLCDBUTTON_CANCEL);
        HandleButtonState(dwButtonState, LGLCDBUTTON_UP);
        HandleButtonState(dwButtonState, LGLCDBUTTON_DOWN);
        HandleButtonState(dwButtonState, LGLCDBUTTON_MENU);
    }
    else
    {
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON0);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON1);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON2);
        HandleButtonState(dwButtonState, LGLCDBUTTON_BUTTON3);
    }

    m_dwButtonState = dwButtonState;
}