aboutsummaryrefslogtreecommitdiff
path: root/Source/MacInput.cpp
diff options
context:
space:
mode:
authoricculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-02 21:06:00 +0000
committericculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-02 21:06:00 +0000
commite17acec1c9bec3a26d97ca2873bb77bdcb48665e (patch)
tree26b14b6cedcb70df651c23dddbf0981970d0bd4d /Source/MacInput.cpp
parent59ca62d601e30b5467f8ecd2cb7d517bc682fc12 (diff)
downloadblackshades-e17acec1c9bec3a26d97ca2873bb77bdcb48665e.tar.gz
Initial revision
git-svn-id: svn://svn.icculus.org/blackshades/trunk@2 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/MacInput.cpp')
-rw-r--r--Source/MacInput.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/Source/MacInput.cpp b/Source/MacInput.cpp
new file mode 100644
index 0000000..a6afc8f
--- /dev/null
+++ b/Source/MacInput.cpp
@@ -0,0 +1,42 @@
+/**> 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
+} \ No newline at end of file