Well in C++ there are several ways to achieve it;
as i don't cross platform program I use the Windows Message system like this:
char bKey[256];
LResult KeyPress( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch( uMsg )
{
case WM_KEYDOWN:
m_bKey[wParam] = TRUE;
break;
case WM_KEYUP:
m_bKey[wParam] = FALSE;
break;
}
return KeyPress( hWnd, uMsg, wParam, lParam );
}
you can assign whatever keys you like to them simply by doing
bKey['w'] = w
bKey['W'] = W
bKey[VK_NUMPAD1] = 1 on the numberpad
bKey[VK_1] = 1 above the keys
if you want to check them all simple do a for((int)i=0; i=>255; i++){ };
and if you want to add support for Asian language keyboards simply extend it to bKey[256^2]
[additional] doing it this way also allows you to actually have different keysets for different windows. this is very useful when application developing; as you can reuse hotkeys, and those keys pressed do not affect others.
but as i said there are multiple ways to do it.
AthlonXP 2500+ | 256MB DDR PC2700 | GeForce FX 5200 44.04 | DirectX 9.0 | Audigy2 | Crystal Clean OS