Exemplo n.º 1
0
void StateHowtoplay::buttonDown(Gosu::Button btn)
{
    if (btn.id() == Gosu::kbEscape || btn.id() == Gosu::msLeft)
    {
        mGame -> changeState("stateMainMenu");
    }
}
Exemplo n.º 2
0
Arquivo: Input.cpp Projeto: 456z/gosu
bool Gosu::Input::down(Gosu::Button btn) const
{
    if (btn == noButton || btn.id() >= numButtons)
        return false;
    
    return pimpl->buttonStates[btn.id()];
}
Exemplo n.º 3
0
bool Gosu::Input::down(Gosu::Button btn) const
{
    if (btn == noButton)
        return false;

    // Will default to false for unknown indices (good).
    return pimpl->keyMap[btn.id()];
}
Exemplo n.º 4
0
wchar_t Gosu::Input::idToChar(Gosu::Button btn)
{
	// Only translate keyboard ids.
    if (btn.id() > 255)
        return 0;

    // Special case...?
    if (btn.id() == kbSpace)
        return L' ';

    // Try to get the key name.
    // (Three elements so too-long names will make GKNT return 3 and we'll know.)
    wchar_t buf[3];
    if (::GetKeyNameText(btn.id() << 16, buf, 3) == 1)
		return /*std::*/towlower(buf[0]);

    return 0;
}