That depends whether you only need exact button presses or whether you also need ‘edge detection’ for your buttons (i.e. detecting the transition rather than the state),
and whether or not you have C++11 access or you need to support C++03 still.
I tried to look but it seems you don’t actually have the source code posted anywhere,
or if you do it’s not linked to in the main post.