Technical Q&As
TX 12 - |
I can't seem to find any documentation for this call; does such
documentation exist? If this is what I think it is, it could be very
useful.
This function tests whether the Command key is being pressed in
conjunction with another key (or keys) that could generate
The caller passes in the event record, which is assumed by the
function to be an event record for a key-down or auto-key event with
the Command key down. The caller also passes in the character to be
tested for (for example, "."). The function returns
|
OSErr HandleKeys (EventRecord *eventPtr) { OSErr err = noErr; if (eventPtr->modifiers & cmdKey) { if (IsCmdChar (eventPtr, '.')) { gStop = true; } else { err = DispatchMenuChoice (MenuKey (eventPtr->message & charCodeMask)); } } return err; } |
Note: The IsCmdChar function returns the
0xFF to represent true. IsCmdChar
does not return 1, so make sure that your code works
correctly when 0xFF is returned. Don't test the function
result against whavever happens to be defined as
true by your development environment unless
you know that true has been defined to be 0xFF .
MacTypes.h defines true == 1 ,
which would cause the expression to always evaluate as
false .
|