aboutsummaryrefslogblamecommitdiff
path: root/Source/MacInput.cpp
blob: a6afc8f1a2a7a09dc26af3255733c4978d1cbce6 (plain) (tree)









































                                                                 
/**> HEADER FILES <**/
#include "MacInput.h"

/**> Mouse Stuff <**/
CursorDevicePtr	theCursor;

/********************> IsKeyDown() <*****/
Boolean	IsKeyDown( unsigned char *keyMap, unsigned short theKey )
{
	long	keyMapIndex;
	Boolean	isKeyDown;
	short	bitToCheck;
	
	// Calculate the key map index
	keyMapIndex = keyMap[theKey/8];
	
	// Calculate the individual bit to check
	bitToCheck = theKey%8;
	
	// Check the status of the key
	isKeyDown = ( keyMapIndex >> bitToCheck ) & 0x01;
	
	// Return the status of the key
	return isKeyDown;
	
}

void 	InitMouse()
{
	CursorDeviceNewDevice( &theCursor ); //Mouse
}

void 	MoveMouse(int xcoord, int ycoord, Point *mouseloc)
{
	CursorDeviceMoveTo( theCursor, xcoord, ycoord);
	GetMouse(mouseloc);
}

void DisposeMouse()
{
	CursorDeviceDisposeDevice( theCursor );//Mouse
}