Skip to content
Snippets Groups Projects
Commit abb97574 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added bsg click tracking

parent fc441aee
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,9 @@ float InputState::mmot_x = 0.f;
float InputState::mmot_y = 0.f;
float InputState::mwheelmot_y = 0.f;
bool InputState::should_quit = false;
bool InputState::b_click = false;
bool InputState::s_click = false;
bool InputState::g_click = false;
void InputState::update(const unsigned width, const unsigned height) {
//reset relative data
......@@ -24,6 +27,9 @@ void InputState::update(const unsigned width, const unsigned height) {
mwheelmot_y = 0.f;
lmb_click = false;
esc_click = false;
b_click = false;
s_click = false;
g_click = false;
SDL_Event event;
while (SDL_PollEvent(&event)) {
......@@ -129,6 +135,15 @@ void InputState::update(const unsigned width, const unsigned height) {
if (event.key.keysym.sym == SDLK_SPACE) {
space_pressed = true;
}
if (event.key.keysym.sym == SDLK_b) {
b_click = true;
}
if (event.key.keysym.sym == SDLK_g) {
g_click = true;
}
if (event.key.keysym.sym == SDLK_s) {
s_click = true;
}
break;
case SDL_KEYUP:
if (event.key.keysym.sym == SDLK_SPACE) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment