To avoid using non-stnadard functions in conio.h, you can use win32 api console functions. Here is how to filter the keys you don't want. This is not the entire program you need, but will get you going so that you can do your own thing with it.
#include <windows.h>
#include <iostream>
#include <vector>
int getkey()
{
bool rvalue = false;
const int MaxEvents = 16;
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
DWORD dwNumRead = 0;
DWORD dwNumEvents = 0;
INPUT_RECORD buf[MaxEvents];
if( GetNumberOfConsoleInputEvents(hStdin, &dwNumEvents) )
{
if( dwNumEvents > 0)
{
memset(buf, 0, sizeof(buf));
// Get the number of events available at the console
if( ReadConsoleInput(hStdin,buf,MaxEvents, &dwNumRead) )
{
// process each event
for(DWORD i = 0; i < dwNumRead; i++)
{
// if keyboard event
if( buf[i].EventType == KEY_EVENT)
{
KEY_EVENT_RECORD* pKey = (KEY_EVENT_RECORD*)&buf[i].Event.KeyEvent;
// if key down event
if( pKey->bKeyDown == TRUE)
{
// test the key type.
if( isdigit(pKey->uChar.AsciiChar) )
{
return pKey->uChar.AsciiChar;
}
else if( pKey->wVirtualKeyCode == VK_RETURN)
return VK_RETURN;
}
}
}
}
}
}
return 0;
}
int main()
{
int key = 0;
while( key != VK_RETURN)
{
while( (key = getkey()) == 0)
Sleep(100);
if( key != VK_RETURN)
std::cout << (char)key << ' ';
}
std::cout << '\n';
}