Skip to content
← Back to Community
C++ Keyboard InputManager v1.0.0
Profile icon
CowNationz

This expands on @SPQR 's 'NON BLOCKING UNBUFFERED CONSOLE INPUT in C'. This is used to be able to whitelist and blacklist certain keys from being outputted in the GetPressedKey function. In a much more user friendly and readable way.
Note:
Make sure you call Update() every frame.
If no keys have been whitelisted, all keys will become whitelisted.
Due to limitations with getch(), only one input can be detected at once.
Enjoy!

Voters
Profile icon
no-no
Profile icon
RobertFurr
Profile icon
Highwayman
Profile icon
amasad
Profile icon
firefish
Profile icon
SPQR
Profile icon
mwilki7
Profile icon
CowNationz
Comments
hotnewtop
Profile icon
SPQR

Yeahhhh code readability isn't exactly my strong suit :P
side note: this isn't non-blocking (i know you never claimed it was but still)
Anyways good job, it's cool to see people make improvements on things i've made :)

Profile icon
CowNationz

@SPQR Thanks!

Profile icon
mwilki7

First someone comes up with a simple console ray tracer, now we've got basic non-blocking keyboard input. We're just a sound library away from a repl console FPS.

Profile icon
no-no

Actual lifesaver, I was trying to find a unbuffered input for a 2d platformer I was trying to make