Set internal/external key with Duo 2

I read over the SDK, but I'm still not sure what is the process of setting up the Duo 2 to use internal or external keying. Can someone please provide the steps or a code snippet that explains this?
https://forum.blackmagicdesign.com/
https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=59000
configuration->SetInt(bmdDeckLinkConfigDuplexMode, bmdDuplexModeFull);
keyer->Enable(true);
keyer->SetLevel(255);
attributes->GetFlag(BMDDeckLinkSupportsExternalKeying, &supportsKeyer)