You can use a key mask.
from AppKit import NSCommandKeyMask
cmdPressed = bool(NSEvent.modifierFlags() & NSCommandKeyMask)
if cmdPressed:
print "Gotcha. You are holding down your CMD key!"
Key masks include:
NSAlphaShiftKeyMask
NSAlternateKeyMask
NSCommandKeyMask
NSControlKeyMask
NSFunctionKeyMask
NSHelpKeyMask
NSNumericPadKeyMask
NSShiftKeyMask
EDIT: More info on https://developer.apple.com/reference/appkit/nseventmodifierflags where I just read that this is going to be deprecated. But the sample above still works.