SDL Input class

Hi, How could I do Input static class in my custom SDL C++ game engine that I can use from any other class?

Simple Example:

1
2
if(Input::GetButtonDown(SDLK_w))
     cout << "Go forward" << endl;


Something like in Unity game engine.
I have successfully created Mouse functions, and it works very well passing 0,1,2 for left right middle mouse button. But keyboard has many, many buttons here.

So my question is, do I have to make function with all keyboard if statements? Or is there some simple trick how to achieve that? Thanks :)
How about this one?
http://www.sdltutorials.com/sdl-events


Wow thanks man, this is exactly what I`ve been looking for :D

Nice
Topic archived. No new replies allowed.