Re: help with intelizing
Re: help with intelizing
- Subject: Re: help with intelizing
- From: Benjámin Salánki <email@hidden>
- Date: Wed, 2 Aug 2006 20:05:07 +0200
didn't get much smarter from the headers you suggested, but found a
mail message on one mailing list from which i derived the following:
static BOOL AnyKeyDown()
{
const UInt32 kCapsLockBit = 0x02L;
KeyMap keys;
GetKeys(keys);
#if (__LITTLE_ENDIAN__)
UInt32 keys0 = CFSwapInt32BigToHost( keys[0].bigEndianValue );
UInt32 keys1 = CFSwapInt32BigToHost( keys[1].bigEndianValue );
UInt32 keys2 = CFSwapInt32BigToHost( keys[2].bigEndianValue );
UInt32 keys3 = CFSwapInt32BigToHost( keys[3].bigEndianValue );
return keys0 || (keys1 & ~kCapsLockBit) || keys2 || keys3;
#else
return keys[0] || (keys[1] & ~kCapsLockBit) || keys[2] || keys[3];
#endif
}
and it seems to work, now I only need to find someone with an Intel
chip Mac to test it on that system as well.
ben
On Aug 2, 2006, at 7:46 PM, John Stiles wrote:
I am pretty sure that the definition of KeyMap changed for Intel.
Check out the headers.
On Aug 2, 2006, at 10:43 AM, Benjámin Salánki wrote:
Hi dear list.
I have a simple function:
static BOOL AnyKeyDown()
{
const UInt32 kCapsLockBit = 0x02L;
KeyMap keys;
GetKeys(keys);
return keys[0] || (keys[1] & ~kCapsLockBit) || keys[2] || keys[3];
}
now this works great when I compile for PPC, but when I try to
compile for Intel I get the following errors:
error: used struct type value where scalar is required
error: invalid operands to binary &
could anyone help me get this to work on Intel as well?
thanks so much,
ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden