| 123 | } |
| 124 | |
| 125 | void 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 | |
| 153 | void Input::mouseButtonEvent(int button, int action, int mods) |
| 154 | { |
nothing calls this directly
no outgoing calls
no test coverage detected