byte _keys_down[256];
// returns nonzero when the given key was hit since the last call
function key_hit(var num)
{
if (num <= 0 || num >= 256) return 0;
if(!_keys_down[num] && key_pressed(num))
{
_keys_down[num] = 1;
return 1;
}
_keys_down[num] = key_pressed(num);
return 0;
}
// returns nonzero when the key with the given name was hit
function key_hit(STRING* keystr)
{
return key_hit(key_for_str(keystr));
}