| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
How in do you get the (128) elements of a KeyMap and read true/false
separately???
I've seen two types of KeyMaps in reference PDF's:
(1) struct KeyMap { UInt32[4] };
(2) typedef long KeyMap[16];
and two types of KeyMaps in Events.h (the one the compiler uses):
(1)typedef UInt32 KeyMap[4];
(2)typedef BigEndianLong KeyMap[4];
(if you notice long and UInt32 are the same)
(and I have no idea what BigEndianLong is)
My compiler gives me an error when I try this:
/*KeyMap*/ keys = /*UInt8*/ trykeys; /*UInt8 trykeys[128]*/
When I do this:
GetKeys((KeyMap) trykeys);
My compiler gives me a new error (as in first time ever gotten).
Eventhough (to me) this should work??
I'm trying to rewrite a cross-platform library that doesn't work with Mac os
9,
the closest thing that would be to it in Carbon is GetKeys.
There is also a glut event handler that is exactly like it, but glut
does not work with Mac os 9 (new versions of glut).
Note: I am extremely bad when it comes to working with bytes (and other valu
es)
BinarySpike
#include <Carbon.h>^^^^^^^^^^^^^^^^^^^
Boolean Done;
KeyMap keys;
UInt8 trykeys[128];
main()
{
while (!Button() && (Done == false))
{
GetKeys((KeyMap)trykeys); // error here:
if (trykeys[24] == true) // if +/= button down
{
Done = true; // Go ahead and quit
SysBeep(2); // Beep Beep
}
}
}
| References: | |
| >GetKeys() and KeyMap? (From: email@hidden) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.