void StateHowtoplay::buttonDown(Gosu::Button btn) { if (btn.id() == Gosu::kbEscape || btn.id() == Gosu::msLeft) { mGame -> changeState("stateMainMenu"); } }
bool Gosu::Input::down(Gosu::Button btn) const { if (btn == noButton || btn.id() >= numButtons) return false; return pimpl->buttonStates[btn.id()]; }
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()]; }
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; }