MCPcopy Create free account
hub / github.com/bwapi/bwapi / getMouseState

Method getMouseState

bwapi/BWAPI/Source/BWAPI/GameImpl.cpp:152–173  ·  view source on GitHub ↗

--------------------------------------------- GET MOUSE STATE --------------------------------------------

Source from the content-addressed store, hash-verified

150 }
151 //--------------------------------------------- GET MOUSE STATE --------------------------------------------
152 bool GameImpl::getMouseState(MouseButton button) const
153 {
154 if ( !this->isFlagEnabled(BWAPI::Flag::UserInput) )
155 return false;
156
157 int vkValue;
158 switch ( button )
159 {
160 case BWAPI::M_LEFT:
161 vkValue = VK_LBUTTON;
162 break;
163 case BWAPI::M_RIGHT:
164 vkValue = VK_RBUTTON;
165 break;
166 case BWAPI::M_MIDDLE:
167 vkValue = VK_MBUTTON;
168 break;
169 default:
170 return false;
171 }
172 return (GetKeyState(vkValue) & 0x80) > 0;
173 }
174 //---------------------------------------------- GET KEY STATE ---------------------------------------------
175 bool GameImpl::getKeyState(Key key) const
176 {

Callers 1

updateSharedMemoryMethod · 0.45

Calls 1

isFlagEnabledMethod · 0.95

Tested by

no test coverage detected