MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / keyEvent

Method keyEvent

src/engine/Input.cpp:125–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void Input::keyEvent(int key, int scancode, int action, int mods)
126{
127 if (key < 0 || key > Input::NUM_KEYS)
128 return;
129
130 if (KEY_ACTION_PRESS == action)
131 {
132 if(!keyState[key])
133 {
134 keyTriggered[key] = true;
135 }
136
137 keyState[key] = true;
138
139 modsTriggered[key] = mods;
140 }
141 else if (KEY_ACTION_REPEAT == action)
142 {
143 keyTriggered[key] = true;
144 modsTriggered[key] = mods;
145 }
146 else if (KEY_ACTION_RELEASE == action)
147 {
148 keyState[key] = false;
149 modsTriggered[key] = 0;
150 }
151}
152
153void Input::mouseButtonEvent(int button, int action, int mods)
154{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected