I know that a specific key, for example a
can be checked as
if (GetKey(olc::A).bPressed){
//do stuff
}
but how can I check if any key is pressed.
Example
if (any key is pressed){
//if i pressed a, it should output a.
std::cout << the key which was pressed was a;
}
I am looking for a pixel game engine specific way to do this but I couldn't find anything on the internet.
Turns out there is no way provided by the engine to do this, but there is a work-around provided to me by some awesome people. Its to set the make you own key char map and store them in a vector with appropriate values. Then iterate through that vector to see if any of those keys are pressed.