How can we rewrite the following function/mechanism to work in cross-platform environments?
BOOL WasKeyDown(KEY_CODE key)
{
if (0x00000001 & GetAsyncKeyState(key))//least significant bit is high
return TRUE; //key WAS down
else return FALSE;
}