Example #1
0
int NothingPressed()
{
	int i;

	keys_nr = GetKeyboard_nr();

	for(i = 0; i < 256; ++i)
	{
		if(keys_nr[i])
		{
			return 0;
		}
	}

	return 1;
}
Example #2
0
int GetKeyPressed()
{
	int key = 0;
	int i;

	keys_nr = GetKeyboard_nr();

	for(i = 0; i < 256 && !key; ++i)
	{
		if(_keyonly(i))
		{
			key = i;
		}
	}

	return key;
}
Example #3
0
// Test button state using current keyboard data.
// Clone of DTestButton, but uses local variables.
int DTestButtonImmediate(ButtConfig *bc)
{
	uint32 x;//mbg merge 7/17/06 changed to uint

	static unsigned int *keys_im=GetKeyboard_nr();

	for(x=0;x<bc->NumC;x++)
	{
		if(bc->ButtType[x]==BUTTC_KEYBOARD)
		{
			if(keys_im[bc->ButtonNum[x]])
			{
				return(1);
			}
		}
	}
	if(DTestButtonJoy(bc)) return(1); // Needs joystick.h. Tested with PPJoy mapped with Print Screen
	return(0);
}