Community Tutorial: Enhanced Input C++

is it possible to apply the mapping context in the c++ code? I am using a custom player controller which means the pawn and controller are spawn at runtime and therefore cannot apply the a mapping contexts in BP like this tutorial and every other tutorial ive found has done.